Add missing return type declaration based on parent class method
class A
{
public function execute(): int
{
}
}
class B extends A{
- public function execute()
+ public function execute(): int
{
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector;
return RectorConfig::configure()
->withRules([
AddReturnTypeDeclarationBasedOnParentClassMethodRector::class,
]);