| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | 19 | protected function validate(string $buildType = self::BUILD_FOR_CREATE): void |
|
| 37 | { |
||
| 38 | 19 | $requiredFields = $this->getRequiredFields($buildType); |
|
| 39 | |||
| 40 | 19 | if (empty($requiredFields)) { |
|
| 41 | 6 | return; |
|
| 42 | } |
||
| 43 | |||
| 44 | 13 | $missingFields = array_diff_key(array_flip($requiredFields), $this->params); |
|
| 45 | 13 | if (!empty($missingFields)) { |
|
| 46 | 6 | throw new InvalidArgumentException(sprintf('Required parameters missing: %s', implode(', ', array_keys($missingFields)))); |
|
| 47 | } |
||
| 50 |