1 | <?php |
||
18 | class EventManager |
||
19 | { |
||
20 | /** |
||
21 | * List with all events |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $list = []; |
||
26 | /** |
||
27 | * Array of events |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $namespaces; |
||
32 | /** |
||
33 | * Project root directory |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $rootDir; |
||
38 | |||
39 | /** |
||
40 | * EventManager constructor. |
||
41 | * |
||
42 | * @param string $rootDir |
||
43 | * @param array $namespaces |
||
44 | */ |
||
45 | public function __construct(string $rootDir, array $namespaces = []) |
||
50 | |||
51 | /** |
||
52 | * Get events list |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | public function getList(): array |
||
74 | |||
75 | /** |
||
76 | * Resolve the given class. |
||
77 | * |
||
78 | * @param string $name |
||
79 | * |
||
80 | * @return EventInterface |
||
81 | */ |
||
82 | public function resolve(string $name): EventInterface |
||
90 | |||
91 | /** |
||
92 | * @inheritDoc |
||
93 | * |
||
94 | * @param string $id |
||
|
|||
95 | * @param EventInterface $event |
||
96 | */ |
||
97 | public function addEvent(EventInterface $event) |
||
105 | } |
||
106 |
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.