| Conditions | 4 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function processRoute(RouteInterface $route): RouteInterface |
||
| 15 | { |
||
| 16 | /** @var ?Operation $operation */ |
||
| 17 | $operation = $route->getAnnotation(Operation::CLASS); |
||
|
|
|||
| 18 | |||
| 19 | if ($operation) { |
||
| 20 | $route = $route |
||
| 21 | ->withRoutable(true) |
||
| 22 | ->withHttpMethod($operation->method); |
||
| 23 | |||
| 24 | if ($operation->path != UNDEFINED) { |
||
| 25 | $route = $route->withPath($operation->path); |
||
| 26 | } |
||
| 27 | |||
| 28 | if ($operation->operationId != UNDEFINED) { |
||
| 29 | $route = $route->withName($operation->operationId); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | return $route; |
||
| 34 | } |
||
| 36 |