| Total Complexity | 6 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class ExportReader |
||
| 13 | { |
||
| 14 | protected $annotationReader; |
||
| 15 | |||
| 16 | public function __construct(Reader $annotationReader) |
||
| 19 | } |
||
| 20 | |||
| 21 | public function getFields(\ReflectionClass $entity): array |
||
| 22 | { |
||
| 23 | $properties = []; |
||
| 24 | |||
| 25 | foreach ($entity->getProperties() as $property) { |
||
| 26 | if ($annotation = $this->annotationReader->getPropertyAnnotation($property, ExportField::class)) { |
||
| 27 | $properties[$annotation->label ?? $property->getName()] = $property->getName(); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return $properties; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getFormats(\ReflectionClass $entity): array |
||
| 41 | } |
||
| 42 | } |
||
| 43 |