mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-08 20:22:24 +00:00
[Php74] Skip readonly on RestoreDefaultNullToNullableTypePropertyRector (#1713)
* [Php74] Skip readonly on RestoreDefaultNullToNullableTypePropertyRector
* Fixed 🎉
This commit is contained in:
parent
369c2f7dfe
commit
88a32076c6
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Tests\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector\Fixture;
|
||||
|
||||
class SkipReadonly
|
||||
{
|
||||
public readonly ?string $name;
|
||||
}
|
|
@ -90,6 +90,10 @@ CODE_SAMPLE
|
|||
return true;
|
||||
}
|
||||
|
||||
if ($property->isReadonly()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// is variable assigned in constructor
|
||||
$propertyName = $this->getName($property);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user