| Conditions | 6 |
| Paths | 16 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 37 | 25 | public function __construct(\Iterator $iterable, $start, $end = null) |
|
| 38 | { |
||
| 39 | 25 | if ($start < 0 || $end < 0) { |
|
| 40 | 9 | $length = iterator_count($iterable); |
|
| 41 | } else { |
||
| 42 | // length is not needed. still, we will define it for code cleanliness |
||
| 43 | 16 | $length = 0; |
|
| 44 | } |
||
| 45 | |||
| 46 | 25 | $this->index = 0; |
|
| 47 | 25 | $this->start = $start < 0 ? $length + $start : $start; |
|
| 48 | 25 | $this->end = $end === null ? null : ($end < 0 ? $length + $end : $end); |
|
| 49 | 25 | parent::__construct($iterable); |
|
| 50 | 25 | } |
|
| 51 | |||
| 91 |
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.