Changes assert calls to use a type hinted closure.
-Bus::assertDispatched(OrderCreated::class, function ($job) {
+Bus::assertDispatched(function (OrderCreated $job) {
return true;
});
Configure your rector.php
:
<?php
use RectorLaravel\Rector\StaticCall\AssertWithClassStringToTypeHintedClosureRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
AssertWithClassStringToTypeHintedClosureRector::class,
]);