Change static call to new instance
class SomeClass
{
public function run()
{
- $dotenv = JsonResponse::create(['foo' => 'bar'], Response::HTTP_OK);
+ $dotenv = new JsonResponse(['foo' => 'bar'], Response::HTTP_OK);
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Transform\Rector\StaticCall\StaticCallToNewRector;
use Rector\Transform\ValueObject\StaticCallToNew;
return RectorConfig::configure()
->withConfiguredRule(StaticCallToNewRector::class, [
new StaticCallToNew('JsonResponse', 'create'),
]);