| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 5 | public function __invoke($start, $stop, $step = 1) |
|
| 22 | { |
||
| 23 | 5 | if (0 == $step) { |
|
| 24 | 1 | throw new \LogicException('$step have to be non-zero'); |
|
| 25 | } |
||
| 26 | |||
| 27 | 4 | $array = []; |
|
| 28 | |||
| 29 | 4 | for ($i = (int)$start; $i < (int)$stop; $i += (int)$step) { |
|
| 30 | 3 | $array[] = $i; |
|
| 31 | } |
||
| 32 | |||
| 33 | 4 | return new Underscore(new Collection($array)); |
|
| 34 | } |
||
| 35 | } |
||
| 36 |