Remove 0 from break and continue
class SomeClass
{
public function run($random)
{
- continue 0;
- break 0;
+ continue;
+ break;
$five = 5;
- continue $five;
+ continue 5;
- break $random;
+ break;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Php54\Rector\Break_\RemoveZeroBreakContinueRector;
return RectorConfig::configure()
->withRules([
RemoveZeroBreakContinueRector::class,
]);