1 | <?php |
||
25 | class PHPCompatibility_Sniffs_PHP_NewUseConstFunctionSniff extends PHPCompatibility_Sniff |
||
|
|||
26 | { |
||
27 | |||
28 | /** |
||
29 | * A list of keywords that can follow use statements. |
||
30 | * |
||
31 | * @var array(string => string) |
||
32 | */ |
||
33 | protected $validUseNames = array( |
||
34 | 'const' => true, |
||
35 | 'function' => true, |
||
36 | ); |
||
37 | |||
38 | /** |
||
39 | * Returns an array of tokens this test wants to listen for. |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | public function register() |
||
47 | |||
48 | |||
49 | /** |
||
50 | * Processes this test, when one of its tokens is encountered. |
||
51 | * |
||
52 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
53 | * @param int $stackPtr The position of the current token in the |
||
54 | * stack passed in $tokens. |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
96 | |||
97 | } |
||
98 |
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.