1 | <?php |
||
17 | abstract class PHPCompatibility_AbstractRemovedFeatureSniff extends PHPCompatibility_AbstractComplexVersionSniff |
||
|
|||
18 | { |
||
19 | |||
20 | |||
21 | /** |
||
22 | * Determine whether an error/warning should be thrown for an item based on collected information. |
||
23 | * |
||
24 | * @param array $errorInfo Detail information about an item. |
||
25 | * |
||
26 | * @return bool |
||
27 | */ |
||
28 | protected function shouldThrowError(array $errorInfo) |
||
32 | |||
33 | |||
34 | /** |
||
35 | * Get an array of the non-PHP-version array keys used in a sub-array. |
||
36 | * |
||
37 | * By default, removed feature version arrays, contain an additional 'alternative' array key. |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | protected function getNonVersionArrayKeys() |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Retrieve the relevant detail (version) information for use in an error message. |
||
49 | * |
||
50 | * @param array $itemArray Version and other information about the item. |
||
51 | * @param array $itemInfo Base information about the item. |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | public function getErrorInfo(array $itemArray, array $itemInfo) |
||
85 | |||
86 | |||
87 | /** |
||
88 | * Get the error message template for suggesting an alternative for a specific sniff. |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | protected function getAlternativeOptionTemplate() |
||
96 | |||
97 | |||
98 | /** |
||
99 | * Generates the error or warning for this item. |
||
100 | * |
||
101 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
102 | * @param int $stackPtr The position of the relevant token in |
||
103 | * the stack. |
||
104 | * @param array $itemInfo Base information about the item. |
||
105 | * @param array $errorInfo Array with detail (version) information |
||
106 | * relevant to the item. |
||
107 | * |
||
108 | * @return void |
||
109 | */ |
||
110 | public function addError(PHP_CodeSniffer_File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) |
||
144 | |||
145 | |||
146 | }//end class |
||
147 |
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.