1 | <?php |
||
13 | class HookRegistry { |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $handlers = []; |
||
19 | |||
20 | /** |
||
21 | * @since 1.0 |
||
22 | * |
||
23 | * @param array $options |
||
|
|||
24 | */ |
||
25 | 20 | public function __construct() { |
|
28 | |||
29 | /** |
||
30 | * @since 1.0 |
||
31 | */ |
||
32 | 18 | public function clear() { |
|
33 | 18 | foreach ( $this->handlers as $name => $callback ) { |
|
34 | 18 | Hooks::clear( $name ); |
|
35 | } |
||
36 | 18 | } |
|
37 | |||
38 | /** |
||
39 | * @since 1.0 |
||
40 | */ |
||
41 | 19 | public function register() { |
|
42 | 19 | foreach ( $this->handlers as $name => $callback ) { |
|
43 | 19 | Hooks::register( $name, $callback ); |
|
44 | } |
||
45 | 19 | } |
|
46 | |||
47 | /** |
||
48 | * @since 1.0 |
||
49 | * |
||
50 | * @param string $name |
||
51 | * |
||
52 | * @return boolean |
||
53 | */ |
||
54 | 1 | public function isRegistered( $name ) { |
|
57 | |||
58 | /** |
||
59 | * @since 1.0 |
||
60 | * |
||
61 | * @param string $name |
||
62 | * |
||
63 | * @return Callable|false |
||
64 | */ |
||
65 | 1 | public function getHandlerFor( $name ) { |
|
68 | |||
69 | private function addCallbackHandlers() { |
||
70 | |||
76 | |||
77 | } |
||
78 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.