DowngradeSubstrFalsyRector
Downgrade substr() with cast string on possibly falsy result
-substr("a", 2);
+(string) substr("a", 2);
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DowngradePhp80\Rector\FuncCall\DowngradeSubstrFalsyRector;
return RectorConfig::configure()
->withRules([
DowngradeSubstrFalsyRector::class,
]);