| Conditions | 4 |
| Paths | 5 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function accept(ReflectionProperty $reflection, PropertyMapping $descriptor, $annotation): void |
||
| 32 | { |
||
| 33 | if (!($annotation instanceof TargetClass)) { |
||
| 34 | return; |
||
| 35 | } |
||
| 36 | $views = $descriptor->getDefaultView(); |
||
| 37 | if (!empty($annotation->views)) { |
||
| 38 | $views = $descriptor->requestViews(...$annotation->views); |
||
| 39 | } |
||
| 40 | $context = $this->contextFactory->createFromReflector($reflection); |
||
| 41 | $className = $this->resolver->resolve($annotation->value, $context); |
||
| 42 | foreach ($views as $view) { |
||
| 43 | $view->setTargetClass((string) $className); |
||
| 44 | } |
||
| 47 |