Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
30 | { |
||
31 | if ($this->supportsBelow('5.3') === false) { |
||
32 | return; |
||
33 | } |
||
34 | |||
35 | $tokens = $phpcsFile->getTokens(); |
||
36 | $token = $tokens[$stackPtr]; |
||
37 | |||
38 | $error = '%s is available since 5.4'; |
||
39 | $data = array(); |
||
40 | |||
41 | if ($token['type'] === 'T_OPEN_SHORT_ARRAY' ) { |
||
42 | $data[] = 'Short array syntax (open)'; |
||
43 | } elseif ($token['type'] === 'T_CLOSE_SHORT_ARRAY' ) { |
||
44 | $data[] = 'Short array syntax (close)'; |
||
45 | } |
||
46 | |||
47 | $phpcsFile->addError($error, $stackPtr, 'Found', $data); |
||
48 | |||
49 | }//end process() |
||
50 | |||
52 |
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.