| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 5 | public function run(array $args) |
|
| 18 | { |
||
| 19 | 5 | $this->expectArguments('range', [['Number']], $args); |
|
| 20 | 4 | if (!isset($args[1])) { |
|
| 21 | 2 | $numbers = $this->getInts(range(0, $args[0]->value())); |
|
| 22 | 2 | return $this->newReturnType('Vector', $numbers); |
|
| 23 | } |
||
| 24 | 2 | if (!$this->isDesmondType('Number', $args[1])) { |
|
| 25 | 1 | throw new ArgumentException('"range" expects argument 2 to be a Number.'); |
|
| 26 | } |
||
| 27 | 1 | $numbers = $this->getInts(range($args[0]->value(), $args[1]->value())); |
|
| 28 | 1 | return $this->newReturnType('Vector', $numbers); |
|
| 29 | } |
||
| 30 | |||
| 38 |