Add function return type void if there is no return
-function restore() {
+function restore(): void {
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\Function_\AddFunctionVoidReturnTypeWhereNoReturnRector;
return RectorConfig::configure()
->withRules([
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
]);