@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $locale = $this->app->getLocale(); |
48 | 48 | |
49 | - if (! $key) { |
|
49 | + if (!$key) { |
|
50 | 50 | return $locale; |
51 | 51 | } |
52 | 52 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | $locale = Localization::fromUrl(); |
88 | 88 | |
89 | - if(in_array($locale, Config::subdomains())){ |
|
89 | + if (in_array($locale, Config::subdomains())) { |
|
90 | 90 | //whitelisted subdomains! like admin.domain.com |
91 | 91 | return false; |
92 | 92 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | //fallback language is the same as the current language |
95 | 95 | if (Config::beautify() && $this->current() === Config::fallbackLocale()) { |
96 | 96 | //didn't found locale means browser is set to exmaple.com |
97 | - if (! $locale) { |
|
97 | + if (!$locale) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | //browser is set to en.example.com but should be forced back to example.com |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function speaks(string $locale) |
118 | 118 | { |
119 | - if (! $this->isSpeaking($locale)) { |
|
119 | + if (!$this->isSpeaking($locale)) { |
|
120 | 120 | return abort(404); //oder error? |
121 | 121 | } |
122 | 122 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | { |
159 | 159 | $locales = Config::supportedLocales(); |
160 | 160 | |
161 | - if (empty($locales) || ! is_array($locales)) { |
|
161 | + if (empty($locales) || !is_array($locales)) { |
|
162 | 162 | throw new SupportedLocalesNotDefined(); |
163 | 163 | } |
164 | 164 | |
165 | - if (! $key) { |
|
165 | + if (!$key) { |
|
166 | 166 | return collect($locales); |
167 | 167 | } |
168 | 168 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | return $this->BCP47($locale, $locales); |
171 | 171 | } |
172 | 172 | |
173 | - if (! array_has($locales, "{$locale}.{$key}")) { |
|
173 | + if (!array_has($locales, "{$locale}.{$key}")) { |
|
174 | 174 | throw new SupportedLocalesNotDefined(); |
175 | 175 | } |
176 | 176 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | { |
211 | 211 | $bcp47 = data_get($locales, "{$locale}.regional"); |
212 | 212 | |
213 | - if (! $bcp47) { |
|
213 | + if (!$bcp47) { |
|
214 | 214 | return $locale; |
215 | 215 | } //locale is the "minimum" of BCP 47 |
216 | 216 |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | { |
20 | 20 | $locale = self::fromUrl(); |
21 | 21 | |
22 | - if (! $locale || ! tongue()->isSpeaking($locale)) { |
|
23 | - if (! Config::beautify()) { |
|
22 | + if (!$locale || !tongue()->isSpeaking($locale)) { |
|
23 | + if (!Config::beautify()) { |
|
24 | 24 | return Config::fallbackLocale(); //redirects see test it_ignoes_cookies_and_redirects.... |
25 | 25 | } |
26 | 26 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected static function languageIsSet() |
87 | 87 | { |
88 | - return ! app()->runningInConsole() || array_has(request()->server(), 'HTTP_ACCEPT_LANGUAGE'); |
|
88 | + return !app()->runningInConsole() || array_has(request()->server(), 'HTTP_ACCEPT_LANGUAGE'); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | return cookie()->queue(cookie()->forever(self::COOKIE, $locale)); |
103 | 103 | } |
104 | 104 | |
105 | - if (! request()->hasCookie(self::COOKIE)) { |
|
105 | + if (!request()->hasCookie(self::COOKIE)) { |
|
106 | 106 | return; |
107 | 107 | } |
108 | 108 |