| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 24 | public static function numbers(int $from, ?int $to = null): Collection |
|
| 44 | { |
||
| 45 | 24 | if ($to === null) { |
|
| 46 | 22 | $to = $from - 1; |
|
| 47 | 22 | $from = 0; |
|
| 48 | } |
||
| 49 | |||
| 50 | 24 | if ($from > $to) { |
|
| 51 | 1 | throw new RuntimeException('FROM need to be less than TO'); |
|
| 52 | } |
||
| 53 | 24 | $list = new ArrayList(); |
|
| 54 | 24 | for ($i = $from; $i <= $to; $i++) { |
|
| 55 | 24 | $list->add($i); |
|
| 56 | } |
||
| 57 | |||
| 58 | 24 | return $list; |
|
| 59 | } |
||
| 86 |