| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 17 | final class TranslateBuilder extends AbstractBuilder |
||
| 18 | { |
||
| 19 | public function __construct(SchemaInterface $schema) |
||
| 20 | { |
||
| 21 | $titleSingular = $this->getInflector()->entityTitleSingular($schema->name()); |
||
| 22 | $titlePlural = $this->getInflector()->entityTitlePlural($schema->name()); |
||
| 23 | $hasFilter = $schema->hasAction(Action::FILTER); |
||
| 24 | $headers = \array_reduce($schema->attributes(), function (array $result, SchemaAttributeInterface $property) { |
||
| 25 | $result[ |
||
| 26 | $this->getInflector()->camelProperty($property->name()) |
||
| 27 | ] = $this->getInflector()->propertyTitle($property->name()); |
||
| 28 | |||
| 29 | return $result; |
||
| 30 | }, []); |
||
| 31 | |||
| 32 | parent::__construct(\compact('titleSingular', 'titlePlural', 'headers', 'hasFilter')); |
||
| 33 | } |
||
| 34 | |||
| 35 | protected function getFileTemplate(): string |
||
| 38 | } |
||
| 39 | |||
| 40 | protected function getPathTemplate(): string |
||
| 43 | } |
||
| 44 | } |
||
| 45 |