@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $user = isset($parsed_url['user']) ? $parsed_url['user'] : ''; |
| 26 | 26 | $pass = isset($parsed_url['pass']) ? ':'.$parsed_url['pass'] : ''; |
| 27 | 27 | $url .= $user.(($user || $pass) ? "$pass@" : ''); |
| 28 | - if (! empty($url)) { |
|
| 28 | + if (!empty($url)) { |
|
| 29 | 29 | $url .= isset($parsed_url['path']) ? '/'.ltrim($parsed_url['path'], '/') : ''; |
| 30 | 30 | } elseif (empty($url)) { |
| 31 | 31 | $url .= isset($parsed_url['path']) ? $parsed_url['path'] : ''; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function translate($routeName, $routeAttributes = null, $locale = null) |
| 124 | 124 | { |
| 125 | 125 | // If no locale is given, we use the current locale |
| 126 | - if (! $locale) { |
|
| 126 | + if (!$locale) { |
|
| 127 | 127 | $locale = tongue()->current(); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $routePath = Accent::findRoutePathByName($routeName); |
| 165 | 165 | |
| 166 | - if (! isset($this->translatedRoutes[$routeName])) { |
|
| 166 | + if (!isset($this->translatedRoutes[$routeName])) { |
|
| 167 | 167 | $this->translatedRoutes[$routeName] = $routePath; |
| 168 | 168 | } |
| 169 | 169 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function current($key = null): string |
| 46 | 46 | { |
| 47 | - if (! $key) { |
|
| 47 | + if (!$key) { |
|
| 48 | 48 | return $this->locale->get(); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | //fallback language is the same as the current language |
| 90 | 90 | if (Config::beautify() && $this->current() === Config::fallbackLocale()) { |
| 91 | 91 | //didn't found locale means browser is set to exmaple.com |
| 92 | - if (! $locale) { |
|
| 92 | + if (!$locale) { |
|
| 93 | 93 | return false; |
| 94 | 94 | } |
| 95 | 95 | //browser is set to en.example.com but should be forced back to example.com |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function speaks(string $locale): self |
| 113 | 113 | { |
| 114 | - if (! $this->isSpeaking($locale)) { |
|
| 114 | + if (!$this->isSpeaking($locale)) { |
|
| 115 | 115 | //locale does not exist. |
| 116 | 116 | return abort(404); |
| 117 | 117 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // this could be a future bug |
| 25 | 25 | // when no middleware is active the language is not set right |
| 26 | 26 | // domain.com could be in german etc... |
| 27 | - if (! Config::beautify()) { |
|
| 27 | + if (!Config::beautify()) { |
|
| 28 | 28 | // if the middleware is active we should be redirected to en.domain.com |
| 29 | 29 | // if not the fallback language is going to be used |
| 30 | 30 | return Config::fallbackLocale(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // could be a custom subdomain |
| 37 | - if (! tongue()->isSpeaking($locale)) { |
|
| 37 | + if (!tongue()->isSpeaking($locale)) { |
|
| 38 | 38 | // check if it is a white listed domain |
| 39 | 39 | if (tongue()->speaking('subdomains', $locale)) { |
| 40 | 40 | return self::currentTongue(); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | protected static function languageIsSet(): bool |
| 85 | 85 | { |
| 86 | - return ! app()->runningInConsole() || Arr::has(request()->server(), 'HTTP_ACCEPT_LANGUAGE'); |
|
| 86 | + return !app()->runningInConsole() || Arr::has(request()->server(), 'HTTP_ACCEPT_LANGUAGE'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function get(): ?string |
| 22 | 22 | { |
| 23 | - if (! $this->has()) { |
|
| 23 | + if (!$this->has()) { |
|
| 24 | 24 | return null; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -11,11 +11,11 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | $locales = Config::supportedLocales(); |
| 13 | 13 | |
| 14 | - if (empty($locales) || ! is_array($locales)) { |
|
| 14 | + if (empty($locales) || !is_array($locales)) { |
|
| 15 | 15 | throw new SupportedLocalesNotDefined(); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - if (! $key) { |
|
| 18 | + if (!$key) { |
|
| 19 | 19 | return collect($locales); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | return $this->getAliases($locale); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if (! Arr::has($locales, "{$locale}.{$key}")) { |
|
| 34 | + if (!Arr::has($locales, "{$locale}.{$key}")) { |
|
| 35 | 35 | throw new SupportedLocalesNotDefined(); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | $bcp47 = data_get($locales, "{$locale}.regional"); |
| 51 | 51 | |
| 52 | - if (! $bcp47) { |
|
| 52 | + if (!$bcp47) { |
|
| 53 | 53 | return $locale; |
| 54 | 54 | } //locale is the "minimum" of BCP 47 |
| 55 | 55 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | protected static function configDomainIsSet(): bool |
| 30 | 30 | { |
| 31 | - if (! $domain = Config::domain()) { |
|
| 31 | + if (!$domain = Config::domain()) { |
|
| 32 | 32 | return false; |
| 33 | 33 | } // config was not set |
| 34 | 34 | |