| 1 | <?php |
||
| 9 | class ChunkedIterator extends IteratorIterator |
||
| 10 | { |
||
| 11 | /** @var int Size of each chunk */ |
||
| 12 | protected $chunkSize; |
||
| 13 | |||
| 14 | /** @var array Current chunk */ |
||
| 15 | protected $chunk; |
||
| 16 | |||
| 17 | /** @var int */ |
||
| 18 | protected $key; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param Traversable $iterator Traversable iterator |
||
| 22 | * @param int $chunkSize Size to make each chunk |
||
| 23 | */ |
||
| 24 | public function __construct(Traversable $iterator, $chunkSize) |
||
| 33 | |||
| 34 | public function rewind() |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return int|mixed |
||
| 43 | */ |
||
| 44 | public function key() |
||
| 48 | |||
| 49 | public function next() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | public function current() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return bool |
||
| 69 | */ |
||
| 70 | public function valid() |
||
| 74 | } |
||
| 75 |
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 theSoncalls the wrong method in the parent class.