1 | <?php |
||
20 | class MethodCollection extends ArrayCollection |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Adds a new Method on collection. |
||
25 | * |
||
26 | * @param MethodInterface $method |
||
27 | * |
||
28 | * @return bool |
||
29 | * |
||
30 | * @throws \InvalidArgumentException |
||
31 | */ |
||
32 | 16 | public function add($method) |
|
44 | |||
45 | /** |
||
46 | * Gets the Method Iterator. |
||
47 | * @return MethodIterator|MethodInterface[] |
||
48 | */ |
||
49 | 12 | public function getIterator() |
|
53 | |||
54 | /** |
||
55 | * Parse the Method Collection to string. |
||
56 | * @return string |
||
57 | */ |
||
58 | 10 | public function toString() |
|
68 | |||
69 | /** |
||
70 | * Removes tags by name. |
||
71 | * |
||
72 | * @param string $methodName |
||
73 | * |
||
74 | * @return MethodCollection Returns a collection with removed methods. |
||
75 | */ |
||
76 | 1 | public function removeByName($methodName) |
|
91 | } |
||
92 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.