Passed
Push — master ( 4108db...a3bd4e )
by Chauncey
41s
created
src/Charcoal/Translator/Translator.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      *
30 30
      * @var string[]
31 31
      */
32
-    private $domains = [ 'messages' ];
32
+    private $domains = ['messages'];
33 33
 
34 34
     /**
35 35
      * @param array $data Constructor data.
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         if (is_array($val)) {
267 267
             return !!array_filter(
268 268
                 $val,
269
-                function ($v, $k) {
269
+                function($v, $k) {
270 270
                     if (is_string($k) && strlen($k) > 0) {
271 271
                         if (is_string($v) && strlen($v) > 0) {
272 272
                             return true;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
      *
131 131
      * @uses   SymfonyTranslator::trans()
132 132
      * @uses   Translator::translation()
133
-     * @param  mixed       $val        The string or translation-object to retrieve.
133
+     * @param  string       $val        The string or translation-object to retrieve.
134 134
      * @param  array       $parameters An array of parameters for the message.
135 135
      * @param  string|null $domain     The domain for the message or NULL to use the default.
136 136
      * @param  string|null $locale     The locale or NULL to use the default.
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Charcoal\Translator;
4 4
 
5
-use RuntimeException;
6
-
7 5
 // From 'symfony/translation'
8 6
 use Symfony\Component\Translation\MessageSelector;
9 7
 use Symfony\Component\Translation\Translator as SymfonyTranslator;
Please login to merge, or discard this patch.
src/Charcoal/Translator/Script/TranslationParserScript.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
 
214 214
     /**
215 215
      * Available locales (languages)
216
-     * @return array Locales.
216
+     * @return string[] Locales.
217 217
      */
218 218
     protected function locales()
219 219
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
                 $t = count($array[$index]);
360 360
                 $locales = $this->locales();
361 361
 
362
-                for (; $i<$t; $i++) {
362
+                for (; $i < $t; $i++) {
363 363
                     $this->climate()->inline('.');
364 364
                     $orig = $array[$index][$i];
365 365
                     foreach ($locales as $lang) {
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         $max = $this->maxRecursiveLevel();
389 389
         $i = 1;
390 390
         $files = glob($pattern, $flags);
391
-        foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR|GLOB_NOSORT)) as $dir) {
391
+        foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR | GLOB_NOSORT)) as $dir) {
392 392
             $files = array_merge($files, $this->globRecursive($dir.'/'.basename($pattern), $flags));
393 393
             $i++;
394 394
             // if ($i >= $max) {
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
             }
474 474
 
475 475
             foreach ($trans as $key => $translation) {
476
-                $data = [ $key, $translation ];
476
+                $data = [$key, $translation];
477 477
                 fputcsv($file, $data, $separator, $enclosure);
478 478
             }
479 479
             fclose($file);
Please login to merge, or discard this patch.
src/Charcoal/Translator/Middleware/LanguageMiddleware.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
     }
232 232
 
233 233
     /**
234
-     * @return mixed
234
+     * @return string
235 235
      */
236 236
     private function getLanguageFromBrowser()
237 237
     {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -7,10 +7,8 @@
 block discarded – undo
7 7
 use Psr\Http\Message\ResponseInterface;
8 8
 
9 9
 // From Pimple
10
-use Pimple\Container;
11 10
 
12 11
 // From `charcoal-translator`
13
-use Charcoal\Translator\LocalesManager;
14 12
 use Charcoal\Translator\TranslatorAwareTrait;
15 13
 
16 14
 /**
Please login to merge, or discard this patch.
src/Charcoal/Translator/ServiceProvider/TranslatorServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
          * @param  Container $container Pimple DI container.
132 132
          * @return LocalesManager
133 133
          */
134
-        $container['locales/manager'] = function (Container $container) {
134
+        $container['locales/manager'] = function(Container $container) {
135 135
             return new LocalesManager([
136 136
                 'locales'             => $container['locales/languages'],
137 137
                 'default_language'    => $container['locales/default-language'],
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
          * @param  Container $container Pimple DI container.
151 151
          * @return TranslatorConfig
152 152
          */
153
-        $container['translator/config'] = function (Container $container) {
153
+        $container['translator/config'] = function(Container $container) {
154 154
             $config = isset($container['config']) ? $container['config'] : [];
155 155
             $translatorConfig = isset($config['translator']) ? $config['translator'] : null;
156 156
             return new TranslatorConfig($translatorConfig);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
          * @param  Container $container Pimple DI container.
161 161
          * @return array
162 162
          */
163
-        $container['translator/translations'] = function (Container $container) {
163
+        $container['translator/translations'] = function(Container $container) {
164 164
             $translatorConfig = $container['translator/config'];
165 165
             return $translatorConfig['translations'];
166 166
         };
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         /**
169 169
          * @return MessageSelector
170 170
          */
171
-        $container['translator/message-selector'] = function () {
171
+        $container['translator/message-selector'] = function() {
172 172
             return new MessageSelector();
173 173
         };
174 174
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
          * @param  Container $container Pimple DI container.
178 178
          * @return Translator
179 179
          */
180
-        $container['translator'] = function (Container $container) {
180
+        $container['translator'] = function(Container $container) {
181 181
             $translatorConfig = $container['translator/config'];
182 182
             $translator = new Translator([
183 183
                 'manager'           => $container['locales/manager'],
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
          * @param Container $container
315 315
          * @return LanguageMiddleware
316 316
          */
317
-        $container['middlewares/charcoal/translator/middleware/language'] = function (Container $container) {
317
+        $container['middlewares/charcoal/translator/middleware/language'] = function(Container $container) {
318 318
             $middlewareConfig = $container['config']['middlewares']['charcoal/translator/middleware/language'];
319 319
             $middlewareConfig = array_replace(
320 320
                 [
Please login to merge, or discard this patch.