| Total Complexity | 9 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 17.65% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait InteractsWithUri |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Get the root URL for the application. |
||
| 14 | * |
||
| 15 | * @return string |
||
| 16 | */ |
||
| 17 | public function root() |
||
| 18 | { |
||
| 19 | return rtrim($this->getSchemeAndHttpHost() . $this->getBaseUrl(), '/'); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get the full URL for the request. |
||
| 24 | * |
||
| 25 | * @return string |
||
| 26 | */ |
||
| 27 | public function fullUrl() |
||
| 28 | { |
||
| 29 | $query = $this->getQueryString(); |
||
| 30 | $question = $this->getBaseUrl() . $this->getPathInfo() == '/' ? '/?' : '?'; |
||
| 31 | return $query ? $this->url() . $question . $query : $this->url(); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get the URL (no query string) for the request. |
||
| 36 | * |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function url() |
||
| 40 | { |
||
| 41 | return rtrim(preg_replace('/\?.*/', '', $this->getUri()), '/'); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return array|mixed|string |
||
| 46 | */ |
||
| 47 | 9 | protected function prepareRequestUri() |
|
| 60 | } |
||
| 61 | } |
||
| 62 |