Updated Rector to commit 437f96a264be9b974d2c5abcc4f5097bfb57b20e

437f96a264 RestoreDefaultNullToNullableTypePropertyRector: skip `@readonly` phpdoc (#5233)
This commit is contained in:
Tomas Votruba 2023-11-08 12:07:04 +00:00
parent 2adc308c58
commit b0251feb16
2 changed files with 14 additions and 3 deletions

View File

@ -88,7 +88,7 @@ CODE_SAMPLE
if ($onlyProperty->default instanceof Expr) {
return \true;
}
if ($property->isReadonly()) {
if ($this->isReadonly($property)) {
return \true;
}
if (!$this->nodeTypeResolver->isNullableType($property)) {
@ -98,4 +98,15 @@ CODE_SAMPLE
$propertyName = $this->getName($property);
return $this->constructorAssignDetector->isPropertyAssigned($class, $propertyName);
}
private function isReadonly(Property $property) : bool
{
// native readonly
if ($property->isReadonly()) {
return \true;
}
// @readonly annotation
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
$tags = $phpDocInfo->getTagsByName('@readonly');
return $tags !== [];
}
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'cb1b0c7348d1e80806b2e600823dbfa38b9836c7';
public const PACKAGE_VERSION = '437f96a264be9b974d2c5abcc4f5097bfb57b20e';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-11-07 22:49:21';
public const RELEASE_DATE = '2023-11-08 19:04:48';
/**
* @var int
*/