| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 16 | final class TranslateBuilder extends AbstractBuilder |
||
| 17 | { |
||
| 18 | public function __construct(string $entity, array $properties) |
||
| 19 | { |
||
| 20 | $entity = (new Convert($this->getSingularize($entity)))->toTitle(); |
||
| 21 | $headers = \array_reduce($properties, function (array $result, array $property) { |
||
| 22 | $result[$this->getCamelCase($property[Keyword::NAME])] = (new Convert($property[Keyword::NAME]))->toTitle(); |
||
| 23 | |||
| 24 | return $result; |
||
| 25 | }, []); |
||
| 26 | |||
| 27 | parent::__construct(\compact('entity', 'headers')); |
||
| 28 | } |
||
| 29 | |||
| 30 | protected function getFileTemplate(): string |
||
| 33 | } |
||
| 34 | |||
| 35 | protected function getPathTemplate(): string |
||
| 38 | } |
||
| 39 | } |
||
| 40 |