| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function __invoke(UriInterface $uri) |
||
| 15 | { |
||
| 16 | $host = $uri->getHost(); |
||
| 17 | $path = $uri->getPath(); |
||
| 18 | |||
| 19 | if (empty($host)) { |
||
| 20 | return $path; |
||
| 21 | } |
||
| 22 | |||
| 23 | $port = $uri->getPort(); |
||
| 24 | if (!empty($port)) { |
||
| 25 | $host .= ":{$port}"; |
||
| 26 | } |
||
| 27 | |||
| 28 | $scheme = $uri->getScheme(); |
||
| 29 | |||
| 30 | return "{$scheme}://{$host}{$path}"; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |