Conditions | 4 |
Paths | 8 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
19 | 5 | public function __invoke(): Webonyx\Type |
|
20 | { |
||
21 | 5 | $type = $this->typeRegistry->get($this->type->getType()); |
|
22 | |||
23 | 5 | $mode = $this->type->getMode(); |
|
24 | |||
25 | 5 | if (TypeAwareInterface::ITEM_IS_REQUIRED === (TypeAwareInterface::ITEM_IS_REQUIRED & $mode)) { |
|
26 | 2 | \assert($type instanceof Webonyx\NullableType); |
|
27 | 2 | $type = Webonyx\Type::nonNull($type); |
|
28 | } |
||
29 | |||
30 | 5 | if (TypeAwareInterface::IS_LIST === (TypeAwareInterface::IS_LIST & $mode)) { |
|
31 | 3 | $type = Webonyx\Type::listOf($type); |
|
32 | } |
||
33 | |||
34 | 5 | if (TypeAwareInterface::IS_REQUIRED === (TypeAwareInterface::IS_REQUIRED & $mode)) { |
|
35 | 2 | $type = Webonyx\Type::nonNull($type); |
|
36 | } |
||
37 | |||
38 | 5 | return $type; |
|
39 | } |
||
41 |