Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
50 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
51 | { |
||
52 | if ($this->supportsBelow('5.4') === false) { |
||
53 | return; |
||
54 | } |
||
55 | |||
56 | $tokens = $phpcsFile->getTokens(); |
||
57 | $tokenContentLC = strtolower($tokens[$stackPtr]['content']); |
||
58 | |||
59 | if ($tokenContentLC !== $tokens[$stackPtr]['content']) { |
||
60 | $phpcsFile->addError( |
||
61 | 'The keyword \'%s\' was treated in a case-sensitive fashion in certain cases in PHP 5.4 or earlier. Use the lowercase version for consistent support.', |
||
62 | $stackPtr, |
||
63 | 'NonLowercaseFound', |
||
64 | array($tokenContentLC) |
||
65 | ); |
||
66 | } |
||
67 | } |
||
68 | } |
||
69 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.