Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
14 | 7 | public function run(array $args) |
|
15 | { |
||
16 | 7 | $this->enforceTypes($args); |
|
17 | 7 | if (!isset($args[0])) { |
|
18 | 1 | return new NumberType(0); |
|
19 | } |
||
20 | 6 | $value = $args[0]->value(); |
|
21 | 6 | array_shift($args); |
|
22 | 6 | if (empty($args)) { |
|
23 | 2 | return new NumberType($value - $value - $value); |
|
24 | } |
||
25 | 5 | foreach ($args as $number) { |
|
26 | 5 | $value -= $number->value(); |
|
27 | } |
||
28 | 5 | return new NumberType($value); |
|
29 | } |
||
30 | |||
40 |