| Conditions | 6 |
| Paths | 16 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 25 | public function __construct(\Iterator $iterable, $start, $end = null) |
|
| 30 | { |
||
| 31 | 25 | if ($start < 0 || $end < 0) { |
|
| 32 | 9 | $length = iterator_count($iterable); |
|
| 33 | } else { |
||
| 34 | // length is not needed. still, we will define it for code cleanliness |
||
| 35 | 16 | $length = 0; |
|
| 36 | } |
||
| 37 | |||
| 38 | 25 | $this->index = 0; |
|
| 39 | 25 | $this->start = $start < 0 ? $length + $start : $start; |
|
| 40 | 25 | $this->end = $end === null ? null : ($end < 0 ? $length + $end : $end); |
|
| 41 | 25 | parent::__construct($iterable); |
|
| 42 | 25 | } |
|
| 43 | |||
| 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 theSoncalls the wrong method in the parent class.