| 1 | <?php |
||
| 11 | class ChunkIterator extends \IteratorIterator |
||
| 12 | { |
||
| 13 | protected $key = 0; |
||
| 14 | |||
| 15 | /** @var int Size of each chunk */ |
||
| 16 | protected $size; |
||
| 17 | /** @var array Current chunk */ |
||
| 18 | protected $chunk; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param Traversable $iterator Traversable iterator |
||
| 22 | * @param int $size Size to make each chunk |
||
| 23 | * |
||
| 24 | * @throws \InvalidArgumentException |
||
| 25 | */ |
||
| 26 | public function __construct(Traversable $iterator, $size) |
||
| 35 | |||
| 36 | public function rewind() |
||
| 42 | |||
| 43 | public function next() |
||
| 52 | |||
| 53 | public function key() |
||
| 57 | |||
| 58 | public function current() |
||
| 62 | |||
| 63 | public function valid() |
||
| 67 | } |
||
| 68 |
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.