File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2710,7 +2710,8 @@ protected function processAdditional()
2710
2710
2711
2711
if ($ suspectedType === 'property or parameter '
2712
2712
&& (isset (Util \Tokens::$ scopeModifiers [$ this ->tokens [$ x ]['code ' ]]) === true
2713
- || $ this ->tokens [$ x ]['code ' ] === T_VAR )
2713
+ || $ this ->tokens [$ x ]['code ' ] === T_VAR
2714
+ || $ this ->tokens [$ x ]['code ' ] === T_READONLY )
2714
2715
) {
2715
2716
// This will also confirm constructor property promotion parameters, but that's fine.
2716
2717
$ confirmed = true ;
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ class TypeUnion
33
33
/* testTypeUnionPropertyFullyQualified */
34
34
public \Fully \Qualified \NameA |\Fully \Qualified \NameB $ fullyQual ;
35
35
36
+ /* testTypeUnionPropertyWithReadOnlyKeyword */
37
+ protected readonly string |null $ array ;
38
+
36
39
public function paramTypes (
37
40
/* testTypeUnionParam1 */
38
41
int |float $ paramA /* testBitwiseOrParamDefaultValue */ = CONSTANT_A | CONSTANT_B ,
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ public function dataTypeUnion()
105
105
['/* testTypeUnionPropertyNamespaceRelative */ ' ],
106
106
['/* testTypeUnionPropertyPartiallyQualified */ ' ],
107
107
['/* testTypeUnionPropertyFullyQualified */ ' ],
108
+ ['/* testTypeUnionPropertyWithReadOnlyKeyword */ ' ],
108
109
['/* testTypeUnionParam1 */ ' ],
109
110
['/* testTypeUnionParam2 */ ' ],
110
111
['/* testTypeUnionParam3 */ ' ],
You can’t perform that action at this time.
0 commit comments