Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
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 | 2 | $this->dataProvider->provide()['entityClassName'] . 'ResourceMiddleware', |
|
31 | ]; |
||
32 | 2 | if ($this->dataProvider->provide()['has_owner']) { |
|
33 | $middleware[] = '\SlayerBirden\DataFlowServer\Domain\Middleware\ValidateOwnerMiddleware::class'; |
||
34 | } |
||
35 | 2 | $middleware[] = $this->getControllerFullName(); |
|
36 | return [ |
||
37 | [ |
||
38 | 2 | 'path' => '/' . $entity . '/{id:\d+}', |
|
39 | 2 | 'middleware' => $middleware, |
|
40 | 2 | 'name' => 'get_' . $entity, |
|
41 | 'allowed_methods' => ['GET'], |
||
42 | ], |
||
60 |