Dispatch non ShouldQueue jobs to dispatchSync
-dispatch(new SomeJob());
-Bus::dispatch(new SomeJob());
-$this->dispatch(new SomeJob());
+dispatch_sync(new SomeJob());
+Bus::dispatchSync(new SomeJob());
+$this->dispatchSync(new SomeJob());
Configure your rector.php
:
<?php
use RectorLaravel\Rector\FuncCall\DispatchNonShouldQueueToDispatchSyncRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
DispatchNonShouldQueueToDispatchSyncRector::class,
]);