1 | <?php |
||
22 | class PHPCompatibility_Sniffs_PHP_EmptyNonVariableSniff extends PHPCompatibility_Sniff |
||
|
|||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Returns an array of tokens this test wants to listen for. |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | public function register() |
||
34 | |||
35 | /** |
||
36 | * Processes this test, when one of its tokens is encountered. |
||
37 | * |
||
38 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
39 | * @param int $stackPtr The position of the current token in the |
||
40 | * stack passed in $tokens. |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
83 | |||
84 | |||
85 | /** |
||
86 | * Add the error message. |
||
87 | * |
||
88 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
89 | * @param int $stackPtr The position of the current token in the |
||
90 | * stack passed in $tokens. |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | protected function addError($phpcsFile, $stackPtr) |
||
99 | } |
||
100 |
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.