@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $basePath = trim(App::$Properties->get('basePath'), '/'); |
| 62 | 62 | if ($basePath !== null && Str::length($basePath) > 0) { |
| 63 | - $basePath = '/' . $basePath; |
|
| 63 | + $basePath = '/'.$basePath; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | if (!defined('env_no_uri') || env_no_uri === false) { |
| 67 | - $basePath .= '/' . strtolower(env_name); |
|
| 67 | + $basePath .= '/'.strtolower(env_name); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // we never try to use path's without friendly url's |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } else { |
| 91 | 91 | // try to find language in pathway |
| 92 | 92 | foreach (App::$Properties->get('languages') as $lang) { |
| 93 | - if (Str::startsWith('/' . $lang, $this->getPathInfo())) { |
|
| 93 | + if (Str::startsWith('/'.$lang, $this->getPathInfo())) { |
|
| 94 | 94 | $this->language = $lang; |
| 95 | 95 | $this->languageInPath = true; |
| 96 | 96 | } |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | // parse query string |
| 118 | 118 | $queryString = null; |
| 119 | 119 | if (count($this->query->all()) > 0) { |
| 120 | - $queryString = '?' . http_build_query($this->query->all()); |
|
| 120 | + $queryString = '?'.http_build_query($this->query->all()); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // build response with redirect to language-based path |
| 124 | - $response = new Redirect($this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString); |
|
| 124 | + $response = new Redirect($this->getSchemeAndHttpHost().$this->basePath.'/'.$userLang.$this->getPathInfo().$queryString); |
|
| 125 | 125 | $response->send(); |
| 126 | 126 | exit(); |
| 127 | 127 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | if (array_key_exists($pathway, $routing['Redirect'])) { |
| 181 | 181 | $target = $this->getSchemeAndHttpHost(); // . $this->getBasePath() . '/' . rtrim($routing['Redirect'][$pathway], '/'); |
| 182 | 182 | if ($this->getBasePath() !== null && !Str::likeEmpty($this->getBasePath())) { |
| 183 | - $target .= '/' . $this->getBasePath(); |
|
| 183 | + $target .= '/'.$this->getBasePath(); |
|
| 184 | 184 | } |
| 185 | 185 | $target .= rtrim($routing['Redirect'][$pathway], '/'); |
| 186 | 186 | $redirect = new Redirect($target); |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | // find "new path" as binding uri slug |
| 207 | 207 | $binding = array_search($pathway, $map, true); |
| 208 | 208 | // build url to redirection |
| 209 | - $url = $this->getSchemeAndHttpHost() . $this->getBasePath() . '/'; |
|
| 209 | + $url = $this->getSchemeAndHttpHost().$this->getBasePath().'/'; |
|
| 210 | 210 | if (App::$Properties->get('multiLanguage')) { |
| 211 | - $url .= $this->language . '/'; |
|
| 211 | + $url .= $this->language.'/'; |
|
| 212 | 212 | } |
| 213 | 213 | $url .= ltrim($binding, '/'); |
| 214 | 214 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | { |
| 303 | 303 | $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo(); |
| 304 | 304 | if (!Str::startsWith('/', $route)) |
| 305 | - $route = '/' . $route; |
|
| 305 | + $route = '/'.$route; |
|
| 306 | 306 | return $route; |
| 307 | 307 | } |
| 308 | 308 | |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | */ |
| 467 | 467 | public function getFullUrl(): string |
| 468 | 468 | { |
| 469 | - return $this->getSchemeAndHttpHost() . $this->getRequestUri(); |
|
| 469 | + return $this->getSchemeAndHttpHost().$this->getRequestUri(); |
|
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | /** |
@@ -301,8 +301,9 @@ discard block |
||
| 301 | 301 | public function getPathInfo() |
| 302 | 302 | { |
| 303 | 303 | $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo(); |
| 304 | - if (!Str::startsWith('/', $route)) |
|
| 305 | - $route = '/' . $route; |
|
| 304 | + if (!Str::startsWith('/', $route)) { |
|
| 305 | + $route = '/' . $route; |
|
| 306 | + } |
|
| 306 | 307 | return $route; |
| 307 | 308 | } |
| 308 | 309 | |
@@ -445,8 +446,9 @@ discard block |
||
| 445 | 446 | public function getPathWithoutControllerAction(): ?string |
| 446 | 447 | { |
| 447 | 448 | $path = trim($this->getPathInfo(), '/'); |
| 448 | - if ($this->aliasPathTarget !== null) |
|
| 449 | - $path = trim($this->aliasPathTarget, '/'); |
|
| 449 | + if ($this->aliasPathTarget !== null) { |
|
| 450 | + $path = trim($this->aliasPathTarget, '/'); |
|
| 451 | + } |
|
| 450 | 452 | |
| 451 | 453 | $pathArray = explode('/', $path); |
| 452 | 454 | if ($pathArray[0] === Str::lowerCase($this->getController())) { |