1 | <?php |
||
5 | class RepeatIterator extends IteratorIterator implements \Countable |
||
6 | { |
||
7 | protected $count; |
||
8 | protected $currentIteration = 0; |
||
9 | protected $innerCount; |
||
10 | |||
11 | public function __construct(\Traversable $iterator, int $count) |
||
20 | |||
21 | public function count() |
||
28 | |||
29 | public function getIterationCount() |
||
33 | |||
34 | public function getCurrentIteration() |
||
38 | |||
39 | public function rewind() |
||
44 | |||
45 | public function next() |
||
53 | |||
54 | public function valid() |
||
58 | } |
||
59 |
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.