Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public static function getPathInfo(ServerRequestInterface $request): string |
||
12 | { |
||
13 | $serverParams = $request->getServerParams(); |
||
14 | $pathInfo = $serverParams['PATH_INFO'] ?? ''; |
||
15 | $pathInfo = trim($pathInfo, '/'); |
||
16 | if (empty($pathInfo)) { |
||
17 | $pathInfo = 'index/index'; |
||
18 | } |
||
19 | if (strpos($pathInfo, '/') === false) { |
||
20 | $pathInfo .= '/index'; |
||
21 | } |
||
22 | return $pathInfo; |
||
23 | } |
||
25 |