Completed
Push — master ( 0fab66...c72de8 )
by Alberto
13s
created
src/Middleware/I18nMiddleware.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
      * @var array
46 46
      */
47 47
     protected $_defaultConfig = [
48
-        'match' => [],
49
-        'startWith' => [],
48
+        'match' => [ ],
49
+        'startWith' => [ ],
50 50
         'switchLangUrl' => null,
51 51
         'cookie' => [
52 52
             'name' => null,
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @param array $config Configuration.
62 62
      */
63
-    public function __construct(array $config = [])
63
+    public function __construct(array $config = [ ])
64 64
     {
65 65
         $this->setConfig($config);
66 66
     }
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
      */
160 160
     protected function setupLocale(?string $locale) : void
161 161
     {
162
-        $i18nConf = Configure::read('I18n', []);
162
+        $i18nConf = Configure::read('I18n', [ ]);
163 163
         $lang = Hash::get($i18nConf, sprintf('locales.%s', (string)$locale));
164 164
         if ($lang === null) {
165 165
             $lang = Hash::get($i18nConf, 'default');
166
-            $locale = array_search($lang, (array)Hash::get($i18nConf, 'locales', []));
166
+            $locale = array_search($lang, (array)Hash::get($i18nConf, 'locales', [ ]));
167 167
         }
168 168
 
169 169
         Configure::write('I18n.lang', $lang);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         $locale = array_search($new, (array)Configure::read('I18n.locales'));
214 214
         if ($locale === false) {
215
-            throw new BadRequestException(__('Lang "{0}" not supported', [$new]));
215
+            throw new BadRequestException(__('Lang "{0}" not supported', [ $new ]));
216 216
         }
217 217
         $response = $this->getResponseWithCookie($response, $locale);
218 218
 
Please login to merge, or discard this patch.