Conditions | 5 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
23 | 6 | public function process(mixed $argument, ArgumentResolverInterface $argumentResolver): array |
|
24 | { |
||
25 | 6 | if (! $argument instanceof ArgumentInterface) { |
|
26 | 1 | return $argumentResolver->resolve($argument); |
|
27 | } |
||
28 | |||
29 | 5 | $config = [ |
|
30 | 5 | 'name' => $argument->getName(), |
|
31 | 5 | 'description' => $argument->getDescription(), |
|
32 | 5 | 'type' => new LazyType($argument, $this->typeRegistry), |
|
33 | 5 | ]; |
|
34 | |||
35 | 5 | if ($argument instanceof DeprecationReasonAwareInterface) { |
|
36 | 2 | $config['deprecationReason'] = $argument->getDeprecationReason(); |
|
37 | } |
||
38 | |||
39 | 5 | if ($argument instanceof DefaultValueAwareInterface && $argument->hasDefaultValue()) { |
|
40 | 2 | $config['defaultValue'] = $argument->getDefaultValue(); |
|
41 | } |
||
42 | |||
43 | 5 | return $config; |
|
44 | } |
||
46 |