| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | 24 | public function valid() |
|
| 48 | { |
||
| 49 | 24 | while ($this->index < $this->start) { |
|
| 50 | 9 | if (parent::valid()) { |
|
| 51 | 9 | $this->index += 1; |
|
| 52 | 9 | parent::next(); |
|
|
|
|||
| 53 | } else { |
||
| 54 | 1 | return false; |
|
| 55 | } |
||
| 56 | } |
||
| 57 | |||
| 58 | 23 | if (null === $this->end || $this->index < $this->end) { |
|
| 59 | 20 | return parent::valid(); |
|
| 60 | } |
||
| 61 | |||
| 62 | 13 | return false; |
|
| 63 | } |
||
| 64 | |||
| 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.