DowngradeReadonlyPropertyRector
Remove "readonly" property type, add a "@readonly" tag instead
class SomeClass
{
- public readonly string $foo;
+ /**
+ * @readonly
+ */
+ public string $foo;
public function __construct()
{
$this->foo = 'foo';
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector;
return RectorConfig::configure()
->withRules([
DowngradeReadonlyPropertyRector::class,
]);