| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class AbstractFactory implements ConfigPartInterface |
||
| 11 | { |
||
| 12 | const PART_KEY = \Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory::class; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var DataProviderInterface |
||
| 16 | */ |
||
| 17 | private $dataProvider; |
||
| 18 | |||
| 19 | 2 | public function __construct(DataProviderInterface $dataProvider) |
|
| 20 | { |
||
| 21 | 2 | $this->dataProvider = $dataProvider; |
|
| 22 | 2 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @inheritdoc |
||
| 26 | */ |
||
| 27 | 2 | public function getConfig(): array |
|
| 28 | { |
||
| 29 | 2 | $pluralEntityName = $this->dataProvider->provide()['pluralEntityName']; |
|
| 30 | 2 | $name = '\\' . $this->getControllerNamespace() . '\Get' . $pluralEntityName . 'Action::class'; |
|
| 31 | return [ |
||
| 32 | 2 | $name => [ |
|
| 33 | 2 | $this->dataProvider->provide()['entityClassName'] . 'Repository', |
|
| 34 | LoggerInterface::class, |
||
| 35 | 2 | $this->dataProvider->provide()['hydrator_name'], |
|
| 36 | ] |
||
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @inheritdoc |
||
| 42 | */ |
||
| 43 | 2 | public function getCode(): string |
|
| 44 | { |
||
| 45 | 2 | return self::PART_KEY; |
|
| 46 | } |
||
| 47 | |||
| 48 | 2 | private function getControllerNamespace(): string |
|
| 51 | } |
||
| 52 | } |
||
| 53 |