Adds param type declaration based on property type the value is assigned to PHPUnit provider return type declaration
final class SomeClass
{
private string $name;
- public function setName($name)
+ public function setName(string $name)
{
$this->name = $name;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector;
return RectorConfig::configure()
->withRules([
AddParamTypeFromPropertyTypeRector::class,
]);