| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function process(Request $request, RequestHandlerInterface $handler): Response |
|
| 24 | { |
||
| 25 | 2 | $uri = $request->getUri(); |
|
| 26 | 2 | $path = $uri->getPath(); |
|
| 27 | |||
| 28 | // If the path does not begin with the version number, prepend v1 by default for BC compatibility purposes |
||
| 29 | 2 | if (\strpos($path, '/v') !== 0) { |
|
| 30 | 1 | $request = $request->withUri($uri->withPath('/v1' . $uri->getPath())); |
|
| 31 | } |
||
| 32 | |||
| 33 | 2 | return $handler->handle($request); |
|
| 34 | } |
||
| 35 | } |
||
| 36 |