| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 18 | 1 | public function __construct(SchemaInterface $schema, array $actions) |
|
| 19 | { |
||
| 20 | 1 | $login = 'email'; |
|
| 21 | $item = $this->getInflector()->item($schema->name()); |
||
| 22 | 1 | $entity = $this->getInflector()->entity($schema->name()); |
|
| 23 | $fkFns = $this->getFkFunctions($schema->fkRelations()); |
||
| 24 | $pkName = $this->getInflector()->pascalProperty($schema->pkName()); |
||
| 25 | 1 | ||
| 26 | $requests = []; |
||
| 27 | 1 | $actions = \array_reduce($actions, function (array $result, string $action) use (&$requests) { |
|
| 28 | $result[] = $this->getInflector()->camelAction($action); |
||
| 29 | $requests[] = $this->getInflector()->pascalAction($action); |
||
| 30 | |||
| 31 | return $result; |
||
| 32 | }, []); |
||
| 33 | $header = self::getHeaderFile(); |
||
| 34 | $usePatch = $schema->hasAction(Action::PATCH); |
||
| 35 | |||
| 36 | parent::__construct( |
||
| 37 | \compact( |
||
| 38 | 'header', |
||
| 39 | 'entity', |
||
| 40 | 'item', |
||
| 41 | 'actions', |
||
| 42 | 'requests', |
||
| 43 | 'login', |
||
| 44 | 'fkFns', |
||
| 45 | 'pkName', |
||
| 46 | 'usePatch' |
||
| 47 | ) |
||
| 61 |