| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class Routes implements ConfigPartInterface |
||
| 10 | { |
||
| 11 | const PART_KEY = 'routes'; |
||
| 12 | /** |
||
| 13 | * @var DataProviderInterface |
||
| 14 | */ |
||
| 15 | private $dataProvider; |
||
| 16 | |||
| 17 | 2 | public function __construct(DataProviderInterface $dataProvider) |
|
| 20 | 2 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * @inheritdoc |
||
| 24 | */ |
||
| 25 | 2 | public function getConfig(): array |
|
| 26 | { |
||
| 27 | return [ |
||
| 28 | [ |
||
| 29 | 2 | 'path' => '/config', |
|
| 30 | 'middleware' => [ |
||
| 31 | 2 | '\SlayerBirden\DataFlowServer\Authentication\Middleware\TokenMiddleware::class', |
|
| 32 | \Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware::class, |
||
| 33 | 2 | '\SlayerBirden\DataFlowServer\Domain\Middleware\SetOwnerMiddleware::class', |
|
| 34 | 2 | $this->getControllerFullName(), |
|
| 35 | ], |
||
| 36 | 2 | 'name' => 'add_config', |
|
| 37 | 'allowed_methods' => ['POST'], |
||
| 38 | ], |
||
| 39 | ]; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @inheritdoc |
||
| 44 | */ |
||
| 45 | 2 | public function getCode(): string |
|
| 46 | { |
||
| 47 | 2 | return self::PART_KEY; |
|
| 48 | } |
||
| 49 | |||
| 50 | 2 | private function getControllerFullName(): string |
|
| 54 | } |
||
| 55 | } |
||
| 56 |