1 | <?php |
||
21 | class SortedArrayHashMap extends ArrayHashMap |
||
22 | { |
||
23 | /** |
||
24 | * @var ComparatorInterface |
||
25 | */ |
||
26 | protected $criteria; |
||
27 | |||
28 | /** |
||
29 | * SortedArrayHashMap constructor. |
||
30 | * |
||
31 | * @param array $elements |
||
32 | * @param ComparatorInterface|null $criteria |
||
33 | */ |
||
34 | public function __construct(array $elements = array(), ComparatorInterface $criteria = null) |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function set($key, $value) |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function removeAt($key) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function sort(ComparatorInterface $criteria = null) |
||
82 | } |
||
83 |
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.