| Conditions | 5 |
| Paths | 8 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 2 | public function fetchCommits() |
|
| 45 | { |
||
| 46 | 2 | $groupedEvents = $this->groupedEventsArray; |
|
| 47 | |||
| 48 | 2 | if ($this->groupedEventsArray instanceof \Iterator || $this->groupedEventsArray instanceof \IteratorAggregate) { |
|
| 49 | 1 | $groupedEvents = iterator_to_array($this->groupedEventsArray); |
|
| 50 | } |
||
| 51 | |||
| 52 | 2 | if ($this->skip) { |
|
|
|
|||
| 53 | 1 | $groupedEvents = array_slice($groupedEvents, $this->skip); |
|
| 54 | } |
||
| 55 | |||
| 56 | 2 | if ($this->limit) { |
|
| 57 | 1 | $groupedEvents = array_slice($groupedEvents, 0, $this->limit); |
|
| 58 | } |
||
| 59 | |||
| 60 | 2 | return $groupedEvents; |
|
| 61 | } |
||
| 62 | |||
| 77 | } |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: