Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
16 | 4 | public function run(array $args) |
|
17 | { |
||
18 | 4 | $this->expectArguments( |
|
19 | 4 | 'set', |
|
20 | 4 | [0 => ['Hash'], 1 => ['Number', 'Symbol', 'String']], |
|
21 | $args |
||
22 | ); |
||
23 | 2 | if (!isset($args[2])) { |
|
24 | 1 | throw new ArgumentException('"set" expects third argument.'); |
|
25 | } |
||
26 | 1 | $newHash = $args[0]; |
|
27 | 1 | $newHash->set($args[2], $args[1]->value()); |
|
28 | 1 | return $newHash; |
|
29 | } |
||
30 | } |
||
31 |