StrictStringParamConcatRector

Add string type based on concat use

 class SomeClass
 {
-    public function resolve($item)
+    public function resolve(string $item)
     {
         return $item . ' world';
     }
 }

Configure your rector.php:

<?php

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

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