| Conditions | 5 |
| Paths | 9 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function processRoute(RouteInterface $route): RouteInterface |
||
| 14 | { |
||
| 15 | /** @var Route $annotation */ |
||
| 16 | foreach ($route->getAnnotations(Route::CLASS) as $annotation) { |
||
|
|
|||
| 17 | $route = $route |
||
| 18 | ->withRoutable(true) |
||
| 19 | ->withHttpMethod($annotation->method); |
||
| 20 | |||
| 21 | if ($annotation->path) { |
||
| 22 | $route = $route->withPath($annotation->path); |
||
| 23 | } |
||
| 24 | |||
| 25 | if ($annotation->name) { |
||
| 26 | $route = $route->withName($annotation->name); |
||
| 27 | } |
||
| 28 | |||
| 29 | foreach ((array)$annotation->attributes as $key => $value) { |
||
| 30 | $route = $route->withAttribute($key, $value); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | return $route; |
||
| 35 | } |
||
| 37 |