BoolReturnTypeFromBooleanConstAndStrictReturnsRector

Add bool return type when returns mix direct true/false consts with strict bool expressions

 class SomeClass
 {
-    public function resolve($value)
+    public function resolve($value): bool
     {
         if ($value === []) {
             return true;
         }

         return count($value) > 0;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanConstAndStrictReturnsRector;

return RectorConfig::configure()
    ->withRules([
        BoolReturnTypeFromBooleanConstAndStrictReturnsRector::class,
    ]);

Other rules in the Type Declarations set