Completed
Push — master ( 701418...4e7cc4 )
by
unknown
05:57
created
src/Charcoal/Translator/Script/TranslationParserScript.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
     /**
206 206
      * Available locales (languages)
207
-     * @return array Locales.
207
+     * @return string[] Locales.
208 208
      */
209 209
     protected function locales()
210 210
     {
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 
379 379
     /**
380 380
      * Custom path
381
-     * @return [type] [description]
381
+     * @return string [description]
382 382
      */
383 383
     public function path()
384 384
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 
10 10
 // Intra-module (`charcoal-admin`) dependencies
11 11
 use Charcoal\Admin\AdminScript;
12
-
13 12
 use Charcoal\Translator\TranslatorAwareTrait;
14 13
 
15 14
 /**
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         $filePath = str_replace('/', DIRECTORY_SEPARATOR, $base.$output);
151 151
 
152 152
         $this->climate()->backgroundGreen()->out(
153
-            'Make sure to include <light_green>' . $filePath . '</light_green> in your <light_green>translator/paths</light_green> configurations.'
153
+            'Make sure to include <light_green>'.$filePath.'</light_green> in your <light_green>translator/paths</light_green> configurations.'
154 154
         );
155 155
 
156 156
         return $response;
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
 
169 169
 
170 170
         $this->climate()->green()->out(
171
-            'CSV file output: <white>' . $this->filePath() . '</white>'
171
+            'CSV file output: <white>'.$this->filePath().'</white>'
172 172
         );
173 173
 
174 174
         $this->climate()->green()->out(
175
-            'CSV file names: <white>' . $this->domain().'.{locale}.csv</white>'
175
+            'CSV file names: <white>'.$this->domain().'.{locale}.csv</white>'
176 176
         );
177 177
 
178 178
         $this->climate()->green()->out(
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         $path = $this->path();
291 291
 
292 292
         if ($path) {
293
-            $this->climate()->green()->out('Parsing files in <white>' . $path .'</white>');
293
+            $this->climate()->green()->out('Parsing files in <white>'.$path.'</white>');
294 294
             $translations = $this->getTranslationsFromPath($path, 'mustache');
295 295
             return $translations;
296 296
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
         $translations = [];
300 300
         foreach ($paths as $p) {
301
-            $this->climate()->green()->out('Parsing files in <white>' . $p .'</white>');
301
+            $this->climate()->green()->out('Parsing files in <white>'.$p.'</white>');
302 302
             $translations = array_merge_recursive($translations, $this->getTranslationsFromPath($p, 'mustache'));
303 303
         }
304 304
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                 $t = count($array[$index]);
338 338
                 $locales = $this->locales();
339 339
 
340
-                for (; $i<$t; $i++) {
340
+                for (; $i < $t; $i++) {
341 341
                     $this->climate()->inline('.');
342 342
                     $orig = $array[$index][$i];
343 343
                     foreach ($locales as $lang) {
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         }
352 352
 
353 353
         $this->climate()->out('.');
354
-        $this->climate()->green()->out('Translations parsed from ' . $path);
354
+        $this->climate()->green()->out('Translations parsed from '.$path);
355 355
         return $translations;
356 356
     }
357 357
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         $max = $this->maxRecursiveLevel();
367 367
         $i = 1;
368 368
         $files = glob($pattern, $flags);
369
-        foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR|GLOB_NOSORT)) as $dir) {
369
+        foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR | GLOB_NOSORT)) as $dir) {
370 370
             $files = array_merge($files, $this->globRecursive($dir.'/'.basename($pattern), $flags));
371 371
             $i++;
372 372
             if ($i >= $max) {
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     {
422 422
         if (!count($translations)) {
423 423
             $this->climate()->error('
424
-                There was no translations in the provided path ('. $this->path() .')
424
+                There was no translations in the provided path ('. $this->path().')
425 425
                 with the given recursive level ('.$this->maxRecursiveLevel().')
426 426
             ');
427 427
             return $this;
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             }
448 448
 
449 449
             foreach ($trans as $key => $translation) {
450
-                $data = [ $key, $translation ];
450
+                $data = [$key, $translation];
451 451
                 fputcsv($file, $data, $separator, $enclosure);
452 452
             }
453 453
             fclose($file);
Please login to merge, or discard this patch.