| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.0054 |
| 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 | ]; |
||
| 32 | 2 | if ($this->dataProvider->provide()['has_owner']) { |
|
| 33 | $middleware[] = '\SlayerBirden\DataFlowServer\Domain\Middleware\SetOwnerMiddleware::class'; |
||
| 34 | } |
||
| 35 | 2 | $middleware[] = $this->getControllerFullName(); |
|
| 36 | return [ |
||
| 37 | [ |
||
| 38 | 2 | 'path' => '/' . $entity, |
|
| 39 | 2 | 'middleware' => $middleware, |
|
| 40 | 2 | 'name' => 'add_' . $entity, |
|
| 41 | 'allowed_methods' => ['POST'], |
||
| 42 | ], |
||
| 60 |