Conditions | 4 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
21 | 2 | public function analyze( |
|
22 | DefinitionAnalyzer $analyzer, |
||
23 | \ReflectionMethod $reflectionMethod, |
||
24 | ClassDefinition $classDefinition, |
||
25 | MethodDefinition $methodDefinition = null |
||
26 | ) { |
||
27 | // Define property if not exists |
||
28 | 2 | if (!$methodDefinition) { |
|
29 | 2 | $methodDefinition = $classDefinition->defineMethod($reflectionMethod->getName()); |
|
30 | } |
||
31 | // Resolve annotations |
||
32 | 2 | $annotations = $this->reader->getMethodAnnotations($reflectionMethod); |
|
33 | 2 | foreach ($annotations as $annotation) { |
|
34 | 2 | if ($annotation instanceof ResolveMethodInterface) { |
|
35 | 2 | $annotation->resolveMethod($analyzer, $reflectionMethod, $classDefinition, $methodDefinition); |
|
36 | } |
||
37 | } |
||
38 | 2 | } |
|
39 | } |
||
40 |