| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 15 | final class GatewayBuilder extends AbstractBuilder |
||
| 16 | { |
||
| 17 | public function __construct(SchemaInterface $schema, array $actions) |
||
| 18 | { |
||
| 19 | $entity = $this->getInflector()->entity($schema->name()); |
||
| 20 | $item = $this->getInflector()->item($schema->name()); |
||
| 21 | $fkFns = $this->getFkFunctions($schema->fkRelations()); |
||
| 22 | $typeHint = $schema->pkTypeHint(); |
||
| 23 | $actions = \array_reduce($actions, function (array $result, string $action) { |
||
| 24 | $result[] = $this->getInflector()->camelAction($action); |
||
| 25 | |||
| 26 | return $result; |
||
| 27 | }, []); |
||
| 28 | $header = self::getHeaderFile(); |
||
| 29 | |||
| 30 | parent::__construct(\compact('header', 'entity', 'actions', 'item', 'fkFns', 'typeHint')); |
||
| 31 | } |
||
| 32 | |||
| 33 | protected function getFileTemplate(): string |
||
| 34 | { |
||
| 35 | return 'Gateway.php.twig'; |
||
| 36 | } |
||
| 37 | |||
| 38 | protected function getPathTemplate(): string |
||
| 41 | } |
||
| 42 | } |
||
| 43 |