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