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