@@ -135,7 +135,7 @@ public function process(File $phpcsFile, $stackPtr)
135135 $ error = 'PHP property type declarations must be lowercase; expected "%s" but found "%s" ' ;
136136 $ errorCode = 'PropertyTypeFound ' ;
137137
138- if ($ props [ ' type_token ' ] === T_TYPE_INTERSECTION ) {
138+ if (strpos ( $ type , ' & ' ) !== false ) {
139139 // Intersection types don't support simple types.
140140 } else if (strpos ($ type , '| ' ) !== false ) {
141141 $ this ->processUnionType (
@@ -167,7 +167,7 @@ public function process(File $phpcsFile, $stackPtr)
167167 $ error = 'PHP return type declarations must be lowercase; expected "%s" but found "%s" ' ;
168168 $ errorCode = 'ReturnTypeFound ' ;
169169
170- if ($ props [ ' return_type_token ' ] === T_TYPE_INTERSECTION ) {
170+ if (strpos ( $ returnType , ' & ' ) !== false ) {
171171 // Intersection types don't support simple types.
172172 } else if (strpos ($ returnType , '| ' ) !== false ) {
173173 $ this ->processUnionType (
@@ -199,7 +199,7 @@ public function process(File $phpcsFile, $stackPtr)
199199 $ error = 'PHP parameter type declarations must be lowercase; expected "%s" but found "%s" ' ;
200200 $ errorCode = 'ParamTypeFound ' ;
201201
202- if ($ param [ ' type_hint_token ' ] === T_TYPE_INTERSECTION ) {
202+ if (strpos ( $ typeHint , ' & ' ) !== false ) {
203203 // Intersection types don't support simple types.
204204 } else if (strpos ($ typeHint , '| ' ) !== false ) {
205205 $ this ->processUnionType (
0 commit comments