| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 6 | public function addController( |
|
| 14 | string $path, |
||
| 15 | string $controller, |
||
| 16 | string $action, |
||
| 17 | array $methods |
||
| 18 | ): RouteDataProvider |
||
| 19 | { |
||
| 20 | 6 | $route = new RouteDataProvider(); |
|
| 21 | |||
| 22 | $route |
||
| 23 | 6 | ->setName($controller . '::' . $action) |
|
| 24 | 6 | ->setPath($path) |
|
| 25 | 6 | ->setDefaults( |
|
| 26 | [ |
||
| 27 | 6 | '_controller' => $controller, |
|
| 28 | 6 | '_action' => $action |
|
| 29 | ] |
||
| 30 | ) |
||
| 31 | 6 | ->setMethods( |
|
| 32 | 6 | $methods |
|
| 33 | ); |
||
| 34 | |||
| 35 | 6 | return $route; |
|
| 36 | } |
||
| 37 | } |