| Conditions | 7 |
| Paths | 15 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function configureFields(\ReflectionClass $class, ShowMapper $showMapper): void |
||
| 19 | { |
||
| 20 | foreach ($class->getProperties() as $property) { |
||
| 21 | foreach ($this->getPropertyAnnotations($property) as $annotation) { |
||
| 22 | if ($annotation instanceof ShowAssociationField) { |
||
| 23 | $showMapper->add( |
||
| 24 | $property->getName() . '.' . $annotation->getField(), |
||
| 25 | ...$annotation->getSettings() |
||
|
|
|||
| 26 | ); |
||
| 27 | |||
| 28 | continue; |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($annotation instanceof ShowField) { |
||
| 32 | $showMapper->add($property->getName(), ...$annotation->getSettings()); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | foreach ($class->getMethods() as $method) { |
||
| 38 | if ($annotation = $this->getMethodAnnotation($method, ShowField::class)) { |
||
| 39 | $showMapper->add($method->getName(), ...$annotation->getSettings()); |
||
| 40 | } |
||
| 44 |