Configurable

AddPropertyTypeDeclarationRector

Add type to property by added rules, mostly public/property by parent type

 class SomeClass extends ParentClass
 {
-    public $name;
+    public string $name;
 }

Configure your rector.php:

<?php

use PHPStan\Type\StringType;
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector;
use Rector\TypeDeclaration\ValueObject\AddPropertyTypeDeclaration;

return RectorConfig::configure()
    ->withConfiguredRule(AddPropertyTypeDeclarationRector::class, [
        new AddPropertyTypeDeclaration('ParentClass', 'name', new StringType()),
    ]);