| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | protected function ensureRequiredPropertiesAreSet(ComponentPayload $componentPayload) |
||
| 30 | { |
||
| 31 | $requiredProperties = $this->getRequiredProperties(); |
||
| 32 | |||
| 33 | $providedProperties = array_map(function (PropertyType $property) { |
||
| 34 | return $property->getName(); |
||
| 35 | }, $componentPayload->getProperties()); |
||
| 36 | |||
| 37 | $intersection = array_intersect($requiredProperties, $providedProperties); |
||
| 38 | |||
| 39 | if (count($intersection) !== count($requiredProperties)) { |
||
| 40 | $notProvidedProperties = array_diff($requiredProperties, $intersection); |
||
| 41 | |||
| 42 | throw InvalidComponent::requiredPropertyMissing($notProvidedProperties, $this); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 |