mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 437f96a264be9b974d2c5abcc4f5097bfb57b20e
437f96a264
RestoreDefaultNullToNullableTypePropertyRector: skip `@readonly` phpdoc (#5233)
This commit is contained in:
parent
2adc308c58
commit
b0251feb16
|
@ -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 !== [];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue