@@ -135,7 +135,7 @@ public function process(File $phpcsFile, $stackPtr)
135
135
$ error = 'PHP property type declarations must be lowercase; expected "%s" but found "%s" ' ;
136
136
$ errorCode = 'PropertyTypeFound ' ;
137
137
138
- if ($ props [ ' type_token ' ] === T_TYPE_INTERSECTION ) {
138
+ if (strpos ( $ type , ' & ' ) !== false ) {
139
139
// Intersection types don't support simple types.
140
140
} else if (strpos ($ type , '| ' ) !== false ) {
141
141
$ this ->processUnionType (
@@ -167,7 +167,7 @@ public function process(File $phpcsFile, $stackPtr)
167
167
$ error = 'PHP return type declarations must be lowercase; expected "%s" but found "%s" ' ;
168
168
$ errorCode = 'ReturnTypeFound ' ;
169
169
170
- if ($ props [ ' return_type_token ' ] === T_TYPE_INTERSECTION ) {
170
+ if (strpos ( $ returnType , ' & ' ) !== false ) {
171
171
// Intersection types don't support simple types.
172
172
} else if (strpos ($ returnType , '| ' ) !== false ) {
173
173
$ this ->processUnionType (
@@ -199,7 +199,7 @@ public function process(File $phpcsFile, $stackPtr)
199
199
$ error = 'PHP parameter type declarations must be lowercase; expected "%s" but found "%s" ' ;
200
200
$ errorCode = 'ParamTypeFound ' ;
201
201
202
- if ($ param [ ' type_hint_token ' ] === T_TYPE_INTERSECTION ) {
202
+ if (strpos ( $ typeHint , ' & ' ) !== false ) {
203
203
// Intersection types don't support simple types.
204
204
} else if (strpos ($ typeHint , '| ' ) !== false ) {
205
205
$ this ->processUnionType (
0 commit comments