| Conditions | 5 |
| Paths | 4 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 4 | public function __construct(\Iterator $iterable) |
|
| 19 | { |
||
| 20 | 4 | $data = []; |
|
| 21 | 4 | foreach ($iterable as $subIterable) { |
|
| 22 | 3 | if (is_array($subIterable) || $subIterable instanceof \Traversable) { |
|
| 23 | 3 | foreach ($subIterable as $key => $value) { |
|
| 24 | 3 | $data [] = [$key, $value]; |
|
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 | 4 | parent::__construct(new \ArrayIterator($data)); |
|
| 29 | 4 | } |
|
| 30 | |||
| 49 |
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.