Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 1 | public function __construct(?array $properties) |
|
16 | { |
||
17 | 1 | if (null === $properties) { |
|
|
|||
18 | 1 | parent::__construct(static::NAME, null); |
|
19 | |||
20 | 1 | return; |
|
21 | } |
||
22 | |||
23 | 1 | Assert::isNonEmptyList($properties); |
|
24 | 1 | Assert::allIsInstanceOf($properties, PropertyInterface::class); |
|
25 | |||
26 | 1 | $propertiesValue = []; |
|
27 | |||
28 | 1 | foreach ($properties as $property) { |
|
29 | 1 | $propertiesValue[$property->getName()] = $property->toJsonSchema(); |
|
30 | } |
||
31 | |||
32 | 1 | parent::__construct(static::NAME, (object) $propertiesValue); |
|
33 | 1 | } |
|
35 |