Drop the specified abstract class from the bind method and replace it with a closure that returns the abstract class.
-$this->app->bind(SomeClass::class, function (): SomeClass {
+$this->app->bind(function (): SomeClass {
return new SomeClass();
});
Configure your rector.php
:
<?php
use RectorLaravel\Rector\MethodCall\ContainerBindConcreteWithClosureOnlyRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
ContainerBindConcreteWithClosureOnlyRector::class,
]);