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