| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 45 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
| 46 | { |
||
| 47 | if ($this->supportsAbove('7.0')) { |
||
| 48 | $tokens = $phpcsFile->getTokens(); |
||
| 49 | |||
| 50 | $variable = $phpcsFile->findNext(T_VARIABLE, $stackPtr, $stackPtr + 4, false); |
||
| 51 | |||
| 52 | if (isset($tokens[$variable - 1]) && $tokens[$variable - 1]['type'] == 'T_DOLLAR') { |
||
| 53 | $error = sprintf( |
||
| 54 | "Global with variable variables are not allowed since PHP 7.0" |
||
| 55 | ); |
||
| 56 | $phpcsFile->addError($error, $stackPtr); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | } |
||
| 60 | } |
||
| 61 |