Passed
Push — master ( c05588...b38d31 )
by Philipp
04:34
created
src/Tongue.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -207,11 +207,11 @@
 block discarded – undo
207 207
      */
208 208
     protected function BCP47($locale, $locales) 
209 209
     {
210
-       $bcp47 = data_get($locales, "{$locale}.regional");
210
+        $bcp47 = data_get($locales, "{$locale}.regional");
211 211
 
212
-       if(! $bcp47) return $locale; //locale is the "minimum" of BCP 47
212
+        if(! $bcp47) return $locale; //locale is the "minimum" of BCP 47
213 213
 
214
-       //regional value needs to replace underscore
215
-       return str_replace('_', '-', $bcp47);
214
+        //regional value needs to replace underscore
215
+        return str_replace('_', '-', $bcp47);
216 216
     }
217 217
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $locale = $this->app->getLocale();
48 48
 
49
-        if (! $key) {
49
+        if (!$key) {
50 50
             return $locale;
51 51
         }
52 52
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
111 111
      */
112 112
     public function speaks(string $locale)
113 113
     {
114
-        if (! $this->isSpeaking($locale)) {
114
+        if (!$this->isSpeaking($locale)) {
115 115
             return abort(404); //oder error?
116 116
         }
117 117
 
@@ -153,19 +153,19 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $locales = Config::supportedLocales();
155 155
 
156
-        if (empty($locales) || ! is_array($locales)) {
156
+        if (empty($locales) || !is_array($locales)) {
157 157
             throw new SupportedLocalesNotDefined();
158 158
         }
159 159
 
160
-        if (! $key) {
160
+        if (!$key) {
161 161
             return collect($locales);
162 162
         }
163 163
 
164
-        if($key === 'BCP47'){
164
+        if ($key === 'BCP47') {
165 165
             return $this->BCP47($locale, $locales);
166 166
         }
167 167
 
168
-        if (! array_has($locales, "{$locale}.{$key}")) {
168
+        if (!array_has($locales, "{$locale}.{$key}")) {
169 169
             throw new SupportedLocalesNotDefined();
170 170
         }
171 171
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     protected function findLocale()
182 182
     {
183
-        if (! Config::subdomain()) {
183
+        if (!Config::subdomain()) {
184 184
             return false; //use Mcamara Localization
185 185
         }
186 186
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     {
210 210
        $bcp47 = data_get($locales, "{$locale}.regional");
211 211
 
212
-       if(! $bcp47) return $locale; //locale is the "minimum" of BCP 47
212
+       if (!$bcp47) return $locale; //locale is the "minimum" of BCP 47
213 213
 
214 214
        //regional value needs to replace underscore
215 215
        return str_replace('_', '-', $bcp47);
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -209,7 +209,10 @@
 block discarded – undo
209 209
     {
210 210
        $bcp47 = data_get($locales, "{$locale}.regional");
211 211
 
212
-       if(! $bcp47) return $locale; //locale is the "minimum" of BCP 47
212
+       if(! $bcp47) {
213
+           return $locale;
214
+       }
215
+       //locale is the "minimum" of BCP 47
213 216
 
214 217
        //regional value needs to replace underscore
215 218
        return str_replace('_', '-', $bcp47);
Please login to merge, or discard this patch.