changes use of a new throw instance to class string
-throw_if($condition, new MyException('custom message'));
+throw_if($condition, MyException::class, 'custom message');
Configure your rector.php
:
<?php
use RectorLaravel\Rector\FuncCall\ThrowIfAndThrowUnlessExceptionsToUseClassStringRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
ThrowIfAndThrowUnlessExceptionsToUseClassStringRector::class,
]);