Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
16 | 5 | public function run(array $args) |
|
17 | { |
||
18 | 5 | $this->expectArguments('<=', [['Number']], $args); |
|
19 | 5 | $last = $args[0]; |
|
20 | 5 | array_shift($args); |
|
21 | 5 | foreach ($args as $number) { |
|
22 | 5 | if (!$this->isDesmondType('Number', $number)) { |
|
23 | 1 | throw new ArgumentException('"<=" expects arguments to be numbers.'); |
|
24 | } |
||
25 | 5 | if ($number->value() < $last->value()) { |
|
26 | 1 | return $this->newReturnType('False'); |
|
27 | } |
||
28 | 4 | $last = $number; |
|
29 | } |
||
30 | 3 | return $this->newReturnType('True'); |
|
31 | } |
||
32 | } |
||
33 |