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 | \ReflectionProperty $reflectionProperty, |
||
24 | ClassDefinition $classDefinition, |
||
25 | PropertyDefinition $propertyDefinition = null |
||
26 | ) { |
||
27 | // Define property if not exists |
||
28 | 2 | if (!$propertyDefinition) { |
|
29 | 2 | $propertyDefinition = $classDefinition->defineProperty($reflectionProperty->getName()); |
|
30 | } |
||
31 | // Resolve annotations |
||
32 | 2 | $annotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
|
33 | 2 | foreach ($annotations as $annotation) { |
|
34 | 2 | if ($annotation instanceof ResolvePropertyInterface) { |
|
35 | 2 | $annotation->resolveProperty($analyzer, $reflectionProperty, $classDefinition, $propertyDefinition); |
|
36 | } |
||
37 | } |
||
38 | 2 | } |
|
39 | } |
||
40 |