DowngradeVoidCastRector
Replace void casts with proper handling of return values
#[\NoDiscard]
function getPhpVersion(): string
{
return 'PHP 8.5';
}
-(void) getPhpVersion();
+$_void = getPhpVersion();
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DowngradePhp85\Rector\Expression\DowngradeVoidCastRector;
return RectorConfig::configure()
->withRules([
DowngradeVoidCastRector::class,
]);