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()
27102710
27112711 if ($ suspectedType === 'property or parameter '
27122712 && (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 )
27142715 ) {
27152716 // This will also confirm constructor property promotion parameters, but that's fine.
27162717 $ confirmed = true ;
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ class TypeUnion
3333 /* testTypeUnionPropertyFullyQualified */
3434 public \Fully \Qualified \NameA |\Fully \Qualified \NameB $ fullyQual ;
3535
36+ /* testTypeUnionPropertyWithReadOnlyKeyword */
37+ protected readonly string |null $ array ;
38+
3639 public function paramTypes (
3740 /* testTypeUnionParam1 */
3841 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()
105105 ['/* testTypeUnionPropertyNamespaceRelative */ ' ],
106106 ['/* testTypeUnionPropertyPartiallyQualified */ ' ],
107107 ['/* testTypeUnionPropertyFullyQualified */ ' ],
108+ ['/* testTypeUnionPropertyWithReadOnlyKeyword */ ' ],
108109 ['/* testTypeUnionParam1 */ ' ],
109110 ['/* testTypeUnionParam2 */ ' ],
110111 ['/* testTypeUnionParam3 */ ' ],
You can’t perform that action at this time.
0 commit comments