| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 9 | public static function fromArray(array $methodsWithValues): StubSet |
|
| 23 | { |
||
| 24 | 9 | $stubSet = new StubSet(); |
|
| 25 | 9 | foreach ($methodsWithValues as $methodName => $methodValue) { |
|
| 26 | try { |
||
| 27 | 9 | $stubSet->add(new Stub($methodName, $methodValue)); |
|
| 28 | 1 | } catch (\Error $error) { |
|
| 29 | 9 | throw new InvalidArgumentException($error->getMessage()); |
|
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | 8 | return $stubSet; |
|
| 34 | } |
||
| 35 | } |
||
| 36 |