File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,21 @@ public static function findFunctionCallArguments(File $phpcsFile, $stackPtr)
382382 return $ argPtrs ;
383383 }
384384
385+ /**
386+ * Compatibility handler for phpcs 3.x/4.x
387+ * @return array
388+ */
389+ private static function getScopeModifiers ()
390+ {
391+ if (defined ('Tokens::SCOPE_MODIFIERS ' )) {
392+ return Tokens::SCOPE_MODIFIERS ;
393+ }
394+ if (isset (Tokens::$ scopeModifiers )) {
395+ return Tokens::$ scopeModifiers ;
396+ }
397+ return [];
398+ }
399+
385400 /**
386401 * Compatibility handler for phpcs 3.x/4.x
387402 * @param array $tokens
@@ -1675,7 +1690,7 @@ public static function isConstructorPromotion(File $phpcsFile, $stackPtr)
16751690 // 'readonly' keyword, and return true if the previous token is a
16761691 // visibility keyword (eg: `public`).
16771692 for ($ i = $ stackPtr - 1 ; $ i > $ functionIndex ; $ i --) {
1678- if (in_array ($ tokens [$ i ]['code ' ], Tokens:: $ scopeModifiers , true )) {
1693+ if (in_array ($ tokens [$ i ]['code ' ], self :: getScopeModifiers () , true )) {
16791694 return true ;
16801695 }
16811696 if (in_array ($ tokens [$ i ]['code ' ], Tokens::$ emptyTokens , true )) {
You can’t perform that action at this time.
0 commit comments