Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
99 | 2 | public function toArray(): array |
|
100 | { |
||
101 | 2 | $missing = array_diff_key(array_flip($this->required()), $this->variables); |
|
102 | |||
103 | 2 | if (!empty($missing)) { |
|
104 | 1 | throw new InvalidArgumentException('Keys missing [' . implode(',', $missing) . ']'); |
|
105 | } |
||
106 | |||
107 | 2 | return $this->variables; |
|
108 | } |
||
110 |