1 | <?php |
||
14 | class Hooks { |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private $handlers = []; |
||
20 | |||
21 | /** |
||
22 | * @var Cache |
||
23 | */ |
||
24 | private $cache; |
||
25 | |||
26 | /** |
||
27 | * @since 1.0 |
||
28 | * |
||
29 | * @param array $config |
||
30 | */ |
||
31 | 2 | public function __construct( $config = [] ) { |
|
34 | |||
35 | /** |
||
36 | * @since 1.0 |
||
37 | * |
||
38 | * @param Cache $cache |
||
39 | */ |
||
40 | 1 | public function setCache( Cache $cache ) { |
|
43 | |||
44 | /** |
||
45 | * @since 1.0 |
||
46 | */ |
||
47 | public static function hasPropertyCollisions( $var ) { |
||
69 | |||
70 | /** |
||
71 | * @since 1.0 |
||
72 | * |
||
73 | * @param array &$vars |
||
74 | */ |
||
75 | public static function initExtension( &$vars ) { |
||
93 | |||
94 | /** |
||
95 | * @since 1.0 |
||
96 | */ |
||
97 | 1 | public function register() { |
|
102 | |||
103 | /** |
||
104 | * @since 1.0 |
||
105 | */ |
||
106 | 1 | public function deregister() { |
|
118 | |||
119 | /** |
||
120 | * @since 1.0 |
||
121 | * |
||
122 | * @param string $name |
||
123 | * |
||
124 | * @return boolean |
||
125 | */ |
||
126 | 1 | public function isRegistered( $name ) { |
|
129 | |||
130 | /** |
||
131 | * @since 1.0 |
||
132 | * |
||
133 | * @param string $name |
||
134 | * |
||
135 | * @return array |
||
136 | */ |
||
137 | 1 | public function getHandlers( $name ) { |
|
140 | |||
141 | /** |
||
142 | * @since 1.0 |
||
143 | * |
||
144 | * @param Title $title |
||
145 | * @param integer $latestRevID |
||
146 | */ |
||
147 | 1 | public function onIsApprovedRevision( $title, $latestRevID ) { |
|
155 | |||
156 | /** |
||
157 | * @since 1.0 |
||
158 | * |
||
159 | * @param Title $title |
||
160 | * @param Revision|null &$revision |
||
161 | */ |
||
162 | 1 | public function onChangeRevision( $title, &$revision ) { |
|
172 | |||
173 | /** |
||
174 | * @since 1.0 |
||
175 | * |
||
176 | * @param Title $title |
||
177 | * @param integer &$latestRevID |
||
178 | */ |
||
179 | 1 | public function onOverrideRevisionID( $title, &$latestRevID ) { |
|
189 | |||
190 | /** |
||
191 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMW::Property::initProperties |
||
192 | * |
||
193 | * @since 1.0 |
||
194 | * |
||
195 | * @param ProertyRegistry $$registry |
||
|
|||
196 | * @param integer &$latestRevID |
||
197 | */ |
||
198 | 1 | public function onInitProperties( $registry ) { |
|
205 | |||
206 | /** |
||
207 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMWStore::updateDataBefore |
||
208 | * |
||
209 | * @since 1.0 |
||
210 | * |
||
211 | * @param ProertyRegistry $$registry |
||
212 | * @param integer &$latestRevID |
||
213 | */ |
||
214 | 1 | public function onUpdateDataBefore( $store, $semanticData ) { |
|
228 | |||
229 | /** |
||
230 | * @see ?? |
||
231 | * |
||
232 | * @since 1.0 |
||
233 | * |
||
234 | * @param ParserOutput $output |
||
235 | * @param Title $title |
||
236 | * @param integer $rev_id |
||
237 | * @param string $content |
||
238 | */ |
||
239 | 1 | public function onApprovedRevsRevisionApproved( $output, $title, $rev_id, $content ) { |
|
257 | |||
258 | /** |
||
259 | * @see ?? |
||
260 | * |
||
261 | * @since 1.0 |
||
262 | * |
||
263 | * @param Parser $parser |
||
264 | * @param Title $title |
||
265 | * @param integer $timestamp |
||
266 | * @param string $sha1 |
||
267 | */ |
||
268 | 1 | public function onApprovedRevsFileRevisionApproved( $parser, $title, $timestamp, $sha1 ) { |
|
282 | |||
283 | /** |
||
284 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#... |
||
285 | * |
||
286 | * @since 1.0 |
||
287 | * |
||
288 | * @param Title $title |
||
289 | * @param File &$file |
||
290 | */ |
||
291 | 1 | public function onChangeFile( $title, &$file ) { |
|
301 | |||
302 | /** |
||
303 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#... |
||
304 | * |
||
305 | * @since 1.0 |
||
306 | * |
||
307 | * @param Title $title |
||
308 | * @param File &$file |
||
309 | */ |
||
310 | public function onChangeFileBeforeIngestProcessComplete( $title, &$file ) { |
||
320 | |||
321 | 2 | private function registerHandlers( $config ) { |
|
333 | |||
334 | } |
||
335 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.