Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
16 | 6 | public function construct(AnnotationMetadata $metadata, array $parameters) : object |
|
17 | { |
||
18 | 6 | if (array_key_exists(null, $parameters)) { |
|
19 | 6 | $defaultProperty = $metadata->getDefaultProperty(); |
|
20 | 6 | assert($defaultProperty !== null); |
|
21 | |||
22 | 6 | $parameters['value'] = $parameters[null]; |
|
23 | 6 | unset($parameters[null]); |
|
24 | } |
||
25 | |||
26 | 6 | $class = $metadata->getName(); |
|
27 | 6 | return new $class($parameters); |
|
28 | } |
||
30 |