Total Complexity | 10 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
15 | final class TypeResolver |
||
16 | { |
||
17 | 76 | public function __construct(private TagTypeFactory $factory) |
|
18 | { |
||
19 | 76 | } |
|
20 | |||
21 | 26 | public function resolveForParameter( |
|
33 | } |
||
34 | |||
35 | 29 | public function resolveForReturn(?string $methodComment, UseStatements $useStatements): TypeDeclaration |
|
36 | { |
||
37 | 29 | if ($methodComment === null) { |
|
38 | 19 | return TypeDeclaration::absent(); |
|
39 | } |
||
40 | |||
41 | 25 | $returnType = $this->factory->returnTypeFrom($methodComment); |
|
42 | |||
43 | 25 | return $returnType instanceof TagType ? $returnType->resolve($useStatements) : TypeDeclaration::absent(); |
|
44 | } |
||
45 | |||
46 | 26 | public function resolveForAttribute(?string $attributeComment, UseStatements $useStatements): TypeDeclaration |
|
55 | } |
||
56 | } |
||
57 |