@@ -2888,6 +2888,7 @@ protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fie
2888
2888
2889
2889
class PropertyInfo extends VariableLike
2890
2890
{
2891
+ public int $classFlags;
2891
2892
public PropertyName $name;
2892
2893
public ?Expr $defaultValue;
2893
2894
public ?string $defaultValueString;
@@ -2898,6 +2899,7 @@ class PropertyInfo extends VariableLike
2898
2899
*/
2899
2900
public function __construct(
2900
2901
PropertyName $name,
2902
+ int $classFlags,
2901
2903
int $flags,
2902
2904
?Type $type,
2903
2905
?Type $phpDocType,
@@ -2910,6 +2912,7 @@ public function __construct(
2910
2912
?ExposedDocComment $exposedDocComment
2911
2913
) {
2912
2914
$this->name = $name;
2915
+ $this->classFlags = $classFlags;
2913
2916
$this->defaultValue = $defaultValue;
2914
2917
$this->defaultValueString = $defaultValueString;
2915
2918
$this->isDocReadonly = $isDocReadonly;
@@ -3024,6 +3027,8 @@ protected function getFlagsByPhpVersion(): array
3024
3027
3025
3028
if ($this->flags & Modifiers::READONLY) {
3026
3029
$flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_81_VERSION_ID);
3030
+ } elseif ($this->classFlags & Modifiers::READONLY) {
3031
+ $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_82_VERSION_ID);
3027
3032
}
3028
3033
3029
3034
return $flags;
@@ -4383,6 +4388,7 @@ function parseConstLike(
4383
4388
*/
4384
4389
function parseProperty(
4385
4390
Name $class,
4391
+ int $classFlags,
4386
4392
int $flags,
4387
4393
Stmt\PropertyProperty $property,
4388
4394
?Node $type,
@@ -4425,6 +4431,7 @@ function parseProperty(
4425
4431
4426
4432
return new PropertyInfo(
4427
4433
new PropertyName($class, $property->name->__toString()),
4434
+ $classFlags,
4428
4435
$flags,
4429
4436
$propertyType,
4430
4437
$phpDocType ? Type::fromString($phpDocType) : null,
@@ -4713,6 +4720,7 @@ function handleStatements(FileInfo $fileInfo, array $stmts, PrettyPrinterAbstrac
4713
4720
foreach ($classStmt->props as $property) {
4714
4721
$propertyInfos[] = parseProperty(
4715
4722
$className,
4723
+ $classFlags,
4716
4724
$classStmt->flags,
4717
4725
$property,
4718
4726
$classStmt->type,
0 commit comments