| Conditions | 5 |
| Paths | 7 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 20 | 2 | public function analyze( |
|
| 21 | DefinitionAnalyzer $analyzer, |
||
| 22 | ClassDefinition $classDefinition, |
||
| 23 | \ReflectionMethod $reflectionMethod |
||
| 24 | ) {
|
||
| 25 | 2 | $methodName = $reflectionMethod->getName(); |
|
| 26 | // Resolve annotations |
||
| 27 | 2 | $annotations = $this->reader->getMethodAnnotations($reflectionMethod); |
|
| 28 | // Create method definition if annotation is exists |
||
| 29 | 2 | if (count($annotations)) {
|
|
| 30 | // Define method if not exists |
||
| 31 | 2 | if (!$classDefinition->hasMethod($methodName)) {
|
|
| 32 | 2 | $classDefinition->defineMethod($methodName); |
|
| 33 | } |
||
| 34 | // Exec method annotations |
||
| 35 | 2 | foreach ($annotations as $annotation) {
|
|
| 36 | 2 | if ($annotation instanceof ResolveMethodInterface) {
|
|
| 37 | 2 | $annotation->resolveMethod($analyzer, $classDefinition, $reflectionMethod); |
|
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | 2 | } |
|
| 42 | } |
||
| 43 |