@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $matches = $this->getMatchesFromAcceptedLanguages(); |
65 | 65 | |
66 | 66 | foreach ($matches as $key => $q) { |
67 | - if (! empty($this->supportedLanguages[$key])) { |
|
67 | + if (!empty($this->supportedLanguages[$key])) { |
|
68 | 68 | return $key; |
69 | 69 | } |
70 | 70 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | return key($this->supportedLanguages); |
88 | 88 | } |
89 | 89 | |
90 | - if ($this->use_intl && ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
90 | + if ($this->use_intl && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
91 | 91 | $http_accept_language = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); |
92 | 92 | |
93 | - if (! empty($this->supportedLanguages[$http_accept_language])) { |
|
93 | + if (!empty($this->supportedLanguages[$http_accept_language])) { |
|
94 | 94 | return $http_accept_language; |
95 | 95 | } |
96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $remote_host = explode('.', $this->request->server('REMOTE_HOST')); |
100 | 100 | $lang = strtolower(end($remote_host)); |
101 | 101 | |
102 | - if (! empty($this->supportedLanguages[$lang])) { |
|
102 | + if (!empty($this->supportedLanguages[$lang])) { |
|
103 | 103 | return $lang; |
104 | 104 | } |
105 | 105 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | //less than it's parent. |
144 | 144 | $l_ops = explode('-', $l); |
145 | 145 | array_pop($l_ops); |
146 | - while (! empty($l_ops)) { |
|
146 | + while (!empty($l_ops)) { |
|
147 | 147 | //The new generic option needs to be slightly less important than it's base |
148 | 148 | $q -= 0.001; |
149 | 149 | $op = implode('-', $l_ops); |
@@ -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'] : ''; |
@@ -20,11 +20,11 @@ |
||
20 | 20 | 'localization' |
21 | 21 | ); |
22 | 22 | |
23 | - $this->app->singleton('tongue', function ($app) { |
|
23 | + $this->app->singleton('tongue', function($app) { |
|
24 | 24 | return new Tongue($app); |
25 | 25 | }); |
26 | 26 | |
27 | - $this->app->singleton('dialect', function ($app) { |
|
27 | + $this->app->singleton('dialect', function($app) { |
|
28 | 28 | return new Dialect($app); |
29 | 29 | }); |
30 | 30 | } |
@@ -74,24 +74,24 @@ discard block |
||
74 | 74 | //'cy' => ['name' => 'Welsh', 'script' => 'Latn', 'native' => 'Cymraeg', 'regional' => 'cy_GB'], |
75 | 75 | //'da' => ['name' => 'Danish', 'script' => 'Latn', 'native' => 'dansk', 'regional' => 'da_DK'], |
76 | 76 | //'se' => ['name' => 'Northern Sami', 'script' => 'Latn', 'native' => 'davvisámegiella', 'regional' => 'se_NO'], |
77 | - 'de' => ['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'], |
|
77 | + 'de' => ['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'], |
|
78 | 78 | //'luo' => ['name' => 'Luo', 'script' => 'Latn', 'native' => 'Dholuo', 'regional' => ''], |
79 | 79 | //'nv' => ['name' => 'Navajo', 'script' => 'Latn', 'native' => 'Diné bizaad', 'regional' => ''], |
80 | 80 | //'dua' => ['name' => 'Duala', 'script' => 'Latn', 'native' => 'duálá', 'regional' => ''], |
81 | 81 | //'et' => ['name' => 'Estonian', 'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'], |
82 | 82 | //'na' => ['name' => 'Nauru', 'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''], |
83 | 83 | //'guz' => ['name' => 'Ekegusii', 'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''], |
84 | - 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'], |
|
84 | + 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'], |
|
85 | 85 | //'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'], |
86 | 86 | //'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'], |
87 | 87 | //'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'], |
88 | - 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'], |
|
88 | + 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'], |
|
89 | 89 | //'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''], |
90 | 90 | //'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'], |
91 | 91 | //'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''], |
92 | 92 | //'ee' => ['name' => 'Ewe', 'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''], |
93 | 93 | //'fil' => ['name' => 'Filipino', 'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'], |
94 | - 'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'], |
|
94 | + 'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'], |
|
95 | 95 | //'fr-CA' => ['name' => 'Canadian French', 'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'], |
96 | 96 | //'fy' => ['name' => 'Western Frisian', 'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'], |
97 | 97 | //'fur' => ['name' => 'Friulian', 'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'], |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | //'lg' => ['name' => 'Ganda', 'script' => 'Latn', 'native' => 'Luganda', 'regional' => 'lg_UG'], |
163 | 163 | //'luy' => ['name' => 'Oluluyia', 'script' => 'Latn', 'native' => 'Luluhia', 'regional' => ''], |
164 | 164 | //'lb' => ['name' => 'Luxembourgish', 'script' => 'Latn', 'native' => 'Lëtzebuergesch', 'regional' => 'lb_LU'], |
165 | - 'hu' => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'], |
|
165 | + 'hu' => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'], |
|
166 | 166 | //'mgh' => ['name' => 'Makhuwa-Meetto', 'script' => 'Latn', 'native' => 'Makua', 'regional' => ''], |
167 | 167 | //'mg' => ['name' => 'Malagasy', 'script' => 'Latn', 'native' => 'Malagasy', 'regional' => 'mg_MG'], |
168 | 168 | //'mt' => ['name' => 'Maltese', 'script' => 'Latn', 'native' => 'Malti', 'regional' => 'mt_MT'], |
@@ -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 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public function handle($request, Closure $next) |
21 | 21 | { |
22 | - if (tongue()->twister() && ! Config::preventRedirect()) { |
|
22 | + if (tongue()->twister() && !Config::preventRedirect()) { |
|
23 | 23 | return dialect()->redirect(dialect()->redirectURL()); |
24 | 24 | } |
25 | 25 |
@@ -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 |