Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2.004 |
Changes | 0 |
1 | <?php |
||
25 | 2 | public function getConfig(): array |
|
26 | { |
||
27 | 2 | $entity = $this->dataProvider->provide()['refName']; |
|
28 | $middleware = [ |
||
29 | 2 | '\SlayerBirden\DataFlowServer\Authentication\Middleware\TokenMiddleware::class', |
|
30 | \Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware::class, |
||
31 | 2 | $this->dataProvider->provide()['input_filter_middleware_name'], |
|
32 | ]; |
||
33 | 2 | if ($this->dataProvider->provide()['has_owner']) { |
|
34 | $middleware[] = '\SlayerBirden\DataFlowServer\Domain\Middleware\SetOwnerMiddleware::class'; |
||
35 | } |
||
36 | 2 | $middleware[] = $this->getControllerFullName(); |
|
37 | return [ |
||
38 | [ |
||
39 | 2 | 'path' => '/' . $entity, |
|
40 | 2 | 'middleware' => $middleware, |
|
41 | 2 | 'name' => 'add_' . $entity, |
|
42 | 'allowed_methods' => ['POST'], |
||
43 | ], |
||
61 |