Remove useless @readonly annotation on native readonly type
final class SomeClass
{
- /**
- * @readonly
- */
private readonly string $name;
public function __construct(string $name)
{
$this->name = $name;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Property\RemoveUselessReadOnlyTagRector;
return RectorConfig::configure()
->withRules([
RemoveUselessReadOnlyTagRector::class,
]);