Add return bool, based on direct true/false returns
class SomeClass
{
- public function resolve($value)
+ public function resolve($value): bool
{
if ($value) {
return false;
}
return true;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanConstReturnsRector;
return RectorConfig::configure()
->withRules([
BoolReturnTypeFromBooleanConstReturnsRector::class,
]);