| @@ 91-96 (lines=6) @@ | ||
| 88 | } |
|
| 89 | ||
| 90 | // Ignore the ELSE in ELSE IF. We'll process the IF part later. |
|
| 91 | if ($tokens[$stackPtr]['code'] === T_ELSE) { |
|
| 92 | $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); |
|
| 93 | if ($tokens[$next]['code'] === T_IF) { |
|
| 94 | return; |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||
| 98 | if ($tokens[$stackPtr]['code'] === T_WHILE) { |
|
| 99 | // This could be from a DO WHILE, which doesn't have an opening brace. |
|
| @@ 145-151 (lines=7) @@ | ||
| 142 | ||
| 143 | // If function call is directly preceded by a NS_SEPARATOR it points to the |
|
| 144 | // global namespace, so we should still catch it. |
|
| 145 | if ($tokens[$prevToken]['code'] === T_NS_SEPARATOR) { |
|
| 146 | $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($prevToken - 1), null, true); |
|
| 147 | if ($tokens[$prevToken]['code'] === T_STRING) { |
|
| 148 | // Not in the global namespace. |
|
| 149 | return; |
|
| 150 | } |
|
| 151 | } |
|
| 152 | ||
| 153 | if (isset($ignore[$tokens[$prevToken]['code']]) === true) { |
|
| 154 | // Not a call to a PHP function. |
|
| @@ 230-240 (lines=11) @@ | ||
| 227 | // Find the class name. |
|
| 228 | $classNameToken = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); |
|
| 229 | $className = $tokens[$classNameToken]['content']; |
|
| 230 | } else { |
|
| 231 | // Determine the name of the class that the static function |
|
| 232 | // is being called on. But don't process class names represented by |
|
| 233 | // variables as this can be an inexact science. |
|
| 234 | $classNameToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); |
|
| 235 | if ($tokens[$classNameToken]['code'] === T_VARIABLE) { |
|
| 236 | return; |
|
| 237 | } |
|
| 238 | ||
| 239 | $className = $tokens[$classNameToken]['content']; |
|
| 240 | } |
|
| 241 | ||
| 242 | // Some systems are always available. |
|
| 243 | if (isset($this->_ignore[strtolower($className)]) === true) { |
|