@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ->where('is_default', '=', true) |
108 | 108 | ->first(); |
109 | 109 | |
110 | - $default = ! empty($default) ? $default->country : config('contentful.default_country'); |
|
110 | + $default = !empty($default) ? $default->country : config('contentful.default_country'); |
|
111 | 111 | |
112 | 112 | // Cache is cleaned in Console\Commands\SyncLocales (run at least daily) |
113 | 113 | Cache::forever('country_default', $default); |
@@ -124,16 +124,16 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public static function fallback(string $code): string |
126 | 126 | { |
127 | - $fallback = Cache::get('locale_fallback_' . $code); |
|
127 | + $fallback = Cache::get('locale_fallback_'.$code); |
|
128 | 128 | |
129 | 129 | if ($fallback === null) { |
130 | 130 | $locale = static::select('fallback_code') |
131 | 131 | ->where('code', '=', $code) |
132 | 132 | ->first(); |
133 | 133 | |
134 | - $fallback = (! empty($locale) && ! empty($locale->fallback_code)) ? $locale->fallback_code : ''; |
|
134 | + $fallback = (!empty($locale) && !empty($locale->fallback_code)) ? $locale->fallback_code : ''; |
|
135 | 135 | |
136 | - Cache::put('locale_fallback_' . $code, $fallback, 5); |
|
136 | + Cache::put('locale_fallback_'.$code, $fallback, 5); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $fallback; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public static function canBeSave(string $country, string $locale): bool |
150 | 150 | { |
151 | - return ! in_array($country . '_' . $locale, static::_getLocalesDisabled()); |
|
151 | + return !in_array($country.'_'.$locale, static::_getLocalesDisabled()); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function isEnabled(): bool |
172 | 172 | { |
173 | - return ! in_array($this->country . '_' . $this->locale, static::_getLocalesDisabled()); |
|
173 | + return !in_array($this->country.'_'.$this->locale, static::_getLocalesDisabled()); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public static function getAcceptedLanguages(Request $request = null) |
225 | 225 | { |
226 | - $request = ! empty($request) ? $request : request(); |
|
226 | + $request = !empty($request) ? $request : request(); |
|
227 | 227 | |
228 | 228 | $languages = $request->server('HTTP_ACCEPT_LANGUAGE'); |
229 | - if (! empty($languages)) { |
|
229 | + if (!empty($languages)) { |
|
230 | 230 | preg_match_all('/(\W|^)([a-z]{2})([^a-z]|$)/six', $languages, $locales, PREG_PATTERN_ORDER); |
231 | 231 | |
232 | - if (! empty($locales) && ! empty($locales[2])) { |
|
232 | + if (!empty($locales) && !empty($locales[2])) { |
|
233 | 233 | return $locales[2]; |
234 | 234 | } |
235 | 235 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | { |
248 | 248 | $country = static::defaultCountry(); |
249 | 249 | $locales = static::getAcceptedLanguages($request); |
250 | - $locale = ! empty($locales) ? $locales[0] : config('app.fallback_locale'); |
|
250 | + $locale = !empty($locales) ? $locales[0] : config('app.fallback_locale'); |
|
251 | 251 | |
252 | 252 | $localeModel = (new static) |
253 | 253 | ->where('country', $country) |