| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 11 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 45 | public function getBaseRoutePath(Request $request) | ||
| 46 |     { | ||
| 47 | $protocol = $request->getUri()->getScheme(); | ||
| 48 | $baseHost = $request->getUri()->getHost(); | ||
| 49 | $path = $request->getUri()->getPath(); | ||
| 50 |         $pathArr = explode('/',$path); | ||
| 51 | unset($pathArr[count($pathArr)-1]); | ||
| 52 |         $path = implode('/',$pathArr); | ||
| 53 | $port = $request->getUri()->getPort() ? ':' . $request->getUri()->getPort() : ''; | ||
| 54 | $baseUrl = $protocol . '://' . $baseHost . $port . $path; | ||
| 55 | return $baseUrl; | ||
| 56 | } | ||
| 64 | } |