DowngradeUnionTypeTypedPropertyRector
Removes union type property type definition, adding @var annotations instead.
class SomeClass
{
- private string|int $property;
+ /**
+ * @var string|int
+ */
+ private $property;
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector;
return RectorConfig::configure()
->withRules([
DowngradeUnionTypeTypedPropertyRector::class,
]);