1 | <?php |
||
22 | class PHPCompatibility_Sniffs_PHP_EmptyNonVariableSniff extends PHPCompatibility_Sniff |
||
|
|||
23 | { |
||
24 | /** |
||
25 | * List of tokens to check against. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $tokenBlackList = array(); |
||
30 | |||
31 | /** |
||
32 | * Returns an array of tokens this test wants to listen for. |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | public function register() |
||
51 | |||
52 | /** |
||
53 | * Processes this test, when one of its tokens is encountered. |
||
54 | * |
||
55 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
56 | * @param int $stackPtr The position of the current token in the |
||
57 | * stack passed in $tokens. |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
100 | |||
101 | |||
102 | /** |
||
103 | * Add the error message. |
||
104 | * |
||
105 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
106 | * @param int $stackPtr The position of the current token in the |
||
107 | * stack passed in $tokens. |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | protected function addError($phpcsFile, $stackPtr) |
||
116 | } |
||
117 |
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.