1 | <?php |
||
16 | class ImmutableContainer extends Container |
||
17 | { |
||
18 | /** |
||
19 | * @param array $params |
||
20 | */ |
||
21 | 18 | public function __construct(array $params = []) |
|
29 | |||
30 | /** |
||
31 | * @param string $key |
||
32 | * @param mixed $value |
||
33 | * |
||
34 | * @return ContainerInterface |
||
35 | */ |
||
36 | 6 | public function set($key, $value) |
|
43 | |||
44 | /** |
||
45 | * Clone the returned value to ensure any modification does not change our version |
||
46 | * |
||
47 | * @param string $key |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 4 | public function get($key) |
|
55 | |||
56 | /** |
||
57 | * @param string $key |
||
58 | * |
||
59 | * @return ContainerInterface |
||
60 | */ |
||
61 | 5 | public function remove($key) |
|
72 | |||
73 | /** |
||
74 | * @param string $key |
||
75 | * @param mixed $value |
||
76 | * |
||
77 | * @return ContainerInterface |
||
78 | */ |
||
79 | 17 | protected function setParameter($key, $value) |
|
83 | |||
84 | /** |
||
85 | * @param string $key |
||
86 | * |
||
87 | * @return ContainerInterface |
||
88 | */ |
||
89 | 4 | protected function removeParameter($key) |
|
93 | } |
||
94 |
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.