1 | <?php |
||
25 | class PHPCompatibility_Sniffs_PHP_RemovedHashAlgorithmsSniff |
||
|
|||
26 | extends PHPCompatibility_AbstractRemovedFeatureSniff |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * A list of removed hash algorithms, which were present in older versions. |
||
31 | * |
||
32 | * The array lists : version number with false (deprecated) and true (removed). |
||
33 | * If's sufficient to list the first version where the hash algorithm was deprecated/removed. |
||
34 | * |
||
35 | * @var array(string => array(string => bool)) |
||
36 | */ |
||
37 | protected $removedAlgorithms = array( |
||
38 | 'salsa10' => array( |
||
39 | '5.4' => true, |
||
40 | ), |
||
41 | 'salsa20' => array( |
||
42 | '5.4' => true, |
||
43 | ), |
||
44 | ); |
||
45 | |||
46 | /** |
||
47 | * Returns an array of tokens this test wants to listen for. |
||
48 | * |
||
49 | * @return array |
||
50 | */ |
||
51 | public function register() |
||
56 | |||
57 | |||
58 | /** |
||
59 | * Processes this test, when one of its tokens is encountered. |
||
60 | * |
||
61 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
||
62 | * @param int $stackPtr The position of the current token in the |
||
63 | * stack passed in $tokens. |
||
64 | * |
||
65 | * @return void |
||
66 | */ |
||
67 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
85 | |||
86 | |||
87 | /** |
||
88 | * Get the relevant sub-array for a specific item from a multi-dimensional array. |
||
89 | * |
||
90 | * @param array $itemInfo Base information about the item. |
||
91 | * |
||
92 | * @return array Version and other information about the item. |
||
93 | */ |
||
94 | public function getItemArray(array $itemInfo) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * Get the error message template for this sniff. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | protected function getErrorMsgTemplate() |
||
109 | |||
110 | |||
111 | }//end class |
||
112 |
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.