@@ -183,8 +183,8 @@ class Context {
183
183
}
184
184
185
185
class ArrayType extends SimpleType {
186
- public Type $ keyType ;
187
- public Type $ valueType ;
186
+ public /* readonly */ Type $ keyType ;
187
+ public /* readonly */ Type $ valueType ;
188
188
189
189
public static function createGenericArray (): self
190
190
{
@@ -222,8 +222,8 @@ public function equals(SimpleType $other): bool {
222
222
}
223
223
224
224
class SimpleType {
225
- public string $ name ;
226
- public bool $ isBuiltin ;
225
+ public /* readonly */ string $ name ;
226
+ public /* readonly */ bool $ isBuiltin ;
227
227
228
228
public static function fromNode (Node $ node ): SimpleType {
229
229
if ($ node instanceof Node \Name) {
@@ -524,8 +524,8 @@ public function equals(SimpleType $other): bool {
524
524
525
525
class Type {
526
526
/** @var SimpleType[] */
527
- public array $ types ;
528
- public bool $ isIntersection ;
527
+ public /* readonly */ array $ types ;
528
+ public /* readonly */ bool $ isIntersection ;
529
529
530
530
public static function fromNode (Node $ node ): Type {
531
531
if ($ node instanceof Node \UnionType || $ node instanceof Node \IntersectionType) {
@@ -736,9 +736,9 @@ function ($type) { return $type->name; },
736
736
737
737
class ArginfoType {
738
738
/** @var SimpleType[] $classTypes */
739
- public array $ classTypes ;
739
+ public /* readonly */ array $ classTypes ;
740
740
/** @var SimpleType[] $builtinTypes */
741
- private array $ builtinTypes ;
741
+ private /* readonly */ array $ builtinTypes ;
742
742
743
743
/**
744
744
* @param SimpleType[] $classTypes
@@ -774,11 +774,11 @@ class ArgInfo {
774
774
const SEND_BY_REF = "1 " ;
775
775
const SEND_PREFER_REF = "ZEND_SEND_PREFER_REF " ;
776
776
777
- public string $ name ;
778
- public string $ sendBy ;
779
- public bool $ isVariadic ;
777
+ public /* readonly */ string $ name ;
778
+ public /* readonly */ string $ sendBy ;
779
+ public /* readonly */ bool $ isVariadic ;
780
780
public ?Type $ type ;
781
- public ?Type $ phpDocType ;
781
+ public /* readonly */ ?Type $ phpDocType ;
782
782
public ?string $ defaultValue ;
783
783
/** @var AttributeInfo[] */
784
784
public array $ attributes ;
@@ -879,7 +879,7 @@ public function isUnknown(): bool
879
879
}
880
880
881
881
class ConstName extends AbstractConstName {
882
- public string $ const ;
882
+ public /* readonly */ string $ const ;
883
883
884
884
public function __construct (?Name $ namespace , string $ const )
885
885
{
@@ -915,8 +915,8 @@ public function getDeclarationName(): string
915
915
}
916
916
917
917
class ClassConstName extends AbstractConstName {
918
- public Name $ class ;
919
- public string $ const ;
918
+ public /* readonly */ Name $ class ;
919
+ public /* readonly */ string $ const ;
920
920
921
921
public function __construct (Name $ class , string $ const )
922
922
{
@@ -941,8 +941,8 @@ public function getDeclarationName(): string
941
941
}
942
942
943
943
class PropertyName implements VariableLikeName {
944
- public Name $ class ;
945
- public string $ property ;
944
+ public /* readonly */ Name $ class ;
945
+ public /* readonly */ string $ property ;
946
946
947
947
public function __construct (Name $ class , string $ property )
948
948
{
@@ -973,7 +973,7 @@ public function isDestructor(): bool;
973
973
}
974
974
975
975
class FunctionName implements FunctionOrMethodName {
976
- private Name $ name ;
976
+ private /* readonly */ Name $ name ;
977
977
978
978
public function __construct (Name $ name ) {
979
979
$ this ->name = $ name ;
@@ -1041,8 +1041,8 @@ public function isDestructor(): bool {
1041
1041
}
1042
1042
1043
1043
class MethodName implements FunctionOrMethodName {
1044
- public Name $ className ;
1045
- public string $ methodName ;
1044
+ public /* readonly */ Name $ className ;
1045
+ public /* readonly */ string $ methodName ;
1046
1046
1047
1047
public function __construct (Name $ className , string $ methodName ) {
1048
1048
$ this ->className = $ className ;
@@ -1099,11 +1099,12 @@ class ReturnInfo {
1099
1099
self ::REFCOUNT_N ,
1100
1100
];
1101
1101
1102
- public bool $ byRef ;
1102
+ public /* readonly */ bool $ byRef ;
1103
+ // NOT readonly - gets removed when discarding info for older PHP versions
1103
1104
public ?Type $ type ;
1104
- public ?Type $ phpDocType ;
1105
- public bool $ tentativeReturnType ;
1106
- public string $ refcount ;
1105
+ public /* readonly */ ?Type $ phpDocType ;
1106
+ public /* readonly */ bool $ tentativeReturnType ;
1107
+ public /* readonly */ string $ refcount ;
1107
1108
1108
1109
public function __construct (bool $ byRef , ?Type $ type , ?Type $ phpDocType , bool $ tentativeReturnType , ?string $ refcount ) {
1109
1110
$ this ->byRef = $ byRef ;
@@ -1148,19 +1149,19 @@ private function setRefcount(?string $refcount): void
1148
1149
}
1149
1150
1150
1151
class FuncInfo {
1151
- public FunctionOrMethodName $ name ;
1152
- public int $ classFlags ;
1152
+ public /* readonly */ FunctionOrMethodName $ name ;
1153
+ public /* readonly */ int $ classFlags ;
1153
1154
public int $ flags ;
1154
- public ?string $ aliasType ;
1155
+ public /* readonly */ ?string $ aliasType ;
1155
1156
public ?FunctionOrMethodName $ alias ;
1156
- public bool $ isDeprecated ;
1157
+ public /* readonly */ bool $ isDeprecated ;
1157
1158
public bool $ supportsCompileTimeEval ;
1158
- public bool $ verify ;
1159
+ public /* readonly */ bool $ verify ;
1159
1160
/** @var ArgInfo[] */
1160
- public array $ args ;
1161
- public ReturnInfo $ return ;
1162
- public int $ numRequiredArgs ;
1163
- public ?string $ cond ;
1161
+ public /* readonly */ array $ args ;
1162
+ public /* readonly */ ReturnInfo $ return ;
1163
+ public /* readonly */ int $ numRequiredArgs ;
1164
+ public /* readonly */ ?string $ cond ;
1164
1165
public bool $ isUndocumentable ;
1165
1166
public ?int $ minimumPhpVersionIdCompatibility ;
1166
1167
/** @var AttributeInfo[] */
@@ -2100,8 +2101,7 @@ public function __clone()
2100
2101
2101
2102
class EvaluatedValue
2102
2103
{
2103
- /** @var mixed */
2104
- public $value;
2104
+ public /* readonly */ mixed $value;
2105
2105
public SimpleType $type;
2106
2106
public Expr $expr;
2107
2107
public bool $isUnknownConstValue;
@@ -2284,12 +2284,12 @@ abstract class VariableLike
2284
2284
{
2285
2285
public int $flags;
2286
2286
public ?Type $type;
2287
- public ?Type $phpDocType;
2288
- public ?string $link;
2287
+ public /* readonly */ ?Type $phpDocType;
2288
+ public /* readonly */ ?string $link;
2289
2289
public ?int $phpVersionIdMinimumCompatibility;
2290
2290
/** @var AttributeInfo[] */
2291
2291
public array $attributes;
2292
- public ?ExposedDocComment $exposedDocComment;
2292
+ public /* readonly */ ?ExposedDocComment $exposedDocComment;
2293
2293
2294
2294
/**
2295
2295
* @var AttributeInfo[] $attributes
@@ -2464,11 +2464,11 @@ protected function addFlagForVersionsAbove(array $flags, string $flag, int $mini
2464
2464
2465
2465
class ConstInfo extends VariableLike
2466
2466
{
2467
- public ConstOrClassConstName $name;
2468
- public Expr $value;
2467
+ public /* readonly */ ConstOrClassConstName $name;
2468
+ public /* readonly */ Expr $value;
2469
2469
public bool $isDeprecated;
2470
2470
public ?string $valueString;
2471
- public ?string $cond;
2471
+ public /* readonly */ ?string $cond;
2472
2472
public ?string $cValue;
2473
2473
public bool $isUndocumentable;
2474
2474
public bool $isFileCacheAllowed;
@@ -2824,12 +2824,12 @@ protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fie
2824
2824
2825
2825
class PropertyInfo extends VariableLike
2826
2826
{
2827
- public int $classFlags;
2828
- public PropertyName $name;
2829
- public ?Expr $defaultValue;
2830
- public ?string $defaultValueString;
2831
- public bool $isDocReadonly;
2832
- public bool $isVirtual;
2827
+ public /* readonly */ int $classFlags;
2828
+ public /* readonly */ PropertyName $name;
2829
+ public /* readonly */ ?Expr $defaultValue;
2830
+ public /* readonly */ ?string $defaultValueString;
2831
+ public /* readonly */ bool $isDocReadonly;
2832
+ public /* readonly */ bool $isVirtual;
2833
2833
2834
2834
// Map possible variable names to the known string constant, see
2835
2835
// ZEND_KNOWN_STRINGS
@@ -3143,8 +3143,8 @@ public function __clone()
3143
3143
}
3144
3144
3145
3145
class EnumCaseInfo {
3146
- public string $name;
3147
- public ?Expr $value;
3146
+ public /* readonly */ string $name;
3147
+ public /* readonly */ ?Expr $value;
3148
3148
3149
3149
public function __construct(string $name, ?Expr $value) {
3150
3150
$this->name = $name;
@@ -3169,9 +3169,9 @@ public function getDeclaration(array $allConstInfos): string {
3169
3169
}
3170
3170
3171
3171
class AttributeInfo {
3172
- public string $class;
3172
+ public /* readonly */ string $class;
3173
3173
/** @var \PhpParser\Node\Arg[] */
3174
- public array $args;
3174
+ public /* readonly */ array $args;
3175
3175
3176
3176
/** @param \PhpParser\Node\Arg[] $args */
3177
3177
public function __construct(string $class, array $args) {
@@ -3222,30 +3222,30 @@ public function generateCode(string $invocation, string $nameSuffix, array $allC
3222
3222
}
3223
3223
3224
3224
class ClassInfo {
3225
- public Name $name;
3225
+ public /* readonly */ Name $name;
3226
3226
public int $flags;
3227
3227
public string $type;
3228
- public ?string $alias;
3229
- public ?SimpleType $enumBackingType;
3230
- public bool $isDeprecated;
3228
+ public /* readonly */ ?string $alias;
3229
+ public /* readonly */ ?SimpleType $enumBackingType;
3230
+ public /* readonly */ bool $isDeprecated;
3231
3231
public bool $isStrictProperties;
3232
3232
/** @var AttributeInfo[] */
3233
3233
public array $attributes;
3234
3234
public ?ExposedDocComment $exposedDocComment;
3235
3235
public bool $isNotSerializable;
3236
3236
/** @var Name[] */
3237
- public array $extends;
3237
+ public /* readonly */ array $extends;
3238
3238
/** @var Name[] */
3239
- public array $implements;
3239
+ public /* readonly */ array $implements;
3240
3240
/** @var ConstInfo[] */
3241
- public array $constInfos;
3241
+ public /* readonly */ array $constInfos;
3242
3242
/** @var PropertyInfo[] */
3243
- public array $propertyInfos;
3243
+ public /* readonly */ array $propertyInfos;
3244
3244
/** @var FuncInfo[] */
3245
3245
public array $funcInfos;
3246
3246
/** @var EnumCaseInfo[] */
3247
- public array $enumCaseInfos;
3248
- public ?string $cond;
3247
+ public /* readonly */ array $enumCaseInfos;
3248
+ public /* readonly */ ?string $cond;
3249
3249
public ?int $phpVersionIdMinimumCompatibility;
3250
3250
public bool $isUndocumentable;
3251
3251
@@ -4119,8 +4119,8 @@ public function shouldGenerateLegacyArginfo(): bool {
4119
4119
}
4120
4120
4121
4121
class DocCommentTag {
4122
- public string $name;
4123
- public ?string $value;
4122
+ public /* readonly */ string $name;
4123
+ public /* readonly */ ?string $value;
4124
4124
4125
4125
public function __construct(string $name, ?string $value) {
4126
4126
$this->name = $name;
0 commit comments