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 | 1 | public function register() { |
|
78 | |||
79 | /** |
||
80 | * @since 1.0 |
||
81 | */ |
||
82 | 1 | public function deregister() { |
|
94 | |||
95 | /** |
||
96 | * @since 1.0 |
||
97 | * |
||
98 | * @param string $name |
||
99 | * |
||
100 | * @return boolean |
||
101 | */ |
||
102 | 1 | public function isRegistered( $name ) { |
|
105 | |||
106 | /** |
||
107 | * @since 1.0 |
||
108 | * |
||
109 | * @param string $name |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | 1 | public function getHandlers( $name ) { |
|
116 | |||
117 | /** |
||
118 | * @since 1.0 |
||
119 | * |
||
120 | * @param Title $title |
||
121 | * @param integer $latestRevID |
||
122 | */ |
||
123 | 1 | public function onSkipUpdate( $title, $latestRevID ) { |
|
131 | |||
132 | /** |
||
133 | * @since 1.0 |
||
134 | * |
||
135 | * @param Title $title |
||
136 | * @param Revision|null &$revision |
||
137 | */ |
||
138 | 1 | public function onChangeRevision( $title, &$revision ) { |
|
148 | |||
149 | /** |
||
150 | * @since 1.0 |
||
151 | * |
||
152 | * @param Title $title |
||
153 | * @param integer &$latestRevID |
||
154 | */ |
||
155 | 1 | public function onOverrideRevisionID( $title, &$latestRevID ) { |
|
165 | |||
166 | /** |
||
167 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMW::Property::initProperties |
||
168 | * |
||
169 | * @since 1.0 |
||
170 | * |
||
171 | * @param ProertyRegistry $$registry |
||
|
|||
172 | * @param integer &$latestRevID |
||
173 | */ |
||
174 | 1 | public function onInitProperties( $registry ) { |
|
181 | |||
182 | /** |
||
183 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMWStore::updateDataBefore |
||
184 | * |
||
185 | * @since 1.0 |
||
186 | * |
||
187 | * @param ProertyRegistry $$registry |
||
188 | * @param integer &$latestRevID |
||
189 | */ |
||
190 | 1 | public function onUpdateDataBefore( $store, $semanticData ) { |
|
204 | |||
205 | /** |
||
206 | * @see ?? |
||
207 | * |
||
208 | * @since 1.0 |
||
209 | * |
||
210 | * @param ParserOutput $output |
||
211 | * @param Title $title |
||
212 | * @param integer $rev_id |
||
213 | * @param string $content |
||
214 | */ |
||
215 | 1 | public function onApprovedRevsRevisionApproved( $output, $title, $rev_id, $content ) { |
|
233 | |||
234 | /** |
||
235 | * @see ?? |
||
236 | * |
||
237 | * @since 1.0 |
||
238 | * |
||
239 | * @param Parser $parser |
||
240 | * @param Title $title |
||
241 | * @param integer $timestamp |
||
242 | * @param string $sha1 |
||
243 | */ |
||
244 | 1 | public function onApprovedRevsFileRevisionApproved( $parser, $title, $timestamp, $sha1 ) { |
|
258 | |||
259 | /** |
||
260 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#SMW::Config::BeforeCompletion |
||
261 | * |
||
262 | * @since 1.0 |
||
263 | * |
||
264 | * @param array &$config |
||
265 | */ |
||
266 | 1 | public function onConfigBeforeCompletion( &$config ) { |
|
274 | |||
275 | /** |
||
276 | * @see https://www.semantic-mediawiki.org/wiki/Hooks#... |
||
277 | * |
||
278 | * @since 1.0 |
||
279 | * |
||
280 | * @param Title $title |
||
281 | * @param File &$file |
||
282 | */ |
||
283 | 1 | public function onChangeFileBeforeIngestProcessComplete( $title, &$file ) { |
|
293 | |||
294 | 2 | private function registerHandlers( $config ) { |
|
308 | |||
309 | } |
||
310 |
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.