Passed
Push — master ( cf0e90...964728 )
by Michal
10:04
created
config_examples/CheckDictionaries/config.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,25 +14,25 @@
 block discarded – undo
14 14
     return new InvalidConfigInstanceReturnedException('$basePath is not set. Use --params="basePath=/your/base/path"');
15 15
 }
16 16
 
17
-$container = require $basePath . '/app/bootstrap.php';
17
+$container = require $basePath.'/app/bootstrap.php';
18 18
 $containerParameters = $container->getParameters();
19 19
 $translationDirs = $containerParameters['translation']['dirs'] ?? [];
20 20
 
21
-$defaultTranslationDir = $basePath . '/app/lang';
21
+$defaultTranslationDir = $basePath.'/app/lang';
22 22
 if (file_exists($defaultTranslationDir)) {
23
-    $translationDirs[] = $basePath . '/app/lang';
23
+    $translationDirs[] = $basePath.'/app/lang';
24 24
 }
25 25
 
26 26
 $files = Finder::create()->in($translationDirs);
27 27
 $dictionaries = [];
28 28
 foreach ($files as $file) {
29
-    $filePath = (string)$file;
29
+    $filePath = (string) $file;
30 30
     $info = pathinfo($filePath);
31 31
     list($prefix, $lang,) = explode('.', $info['basename'], 3);
32 32
     if (isset($languages) && !in_array($lang, $languages)) {
33 33
         continue;
34 34
     }
35
-    $storage = new NeonFileStorage($filePath, $prefix . '.', '    ');
35
+    $storage = new NeonFileStorage($filePath, $prefix.'.', '    ');
36 36
     $dictionaries[$lang] = array_merge($dictionaries[$lang] ?? [], $storage->load());
37 37
 }
38 38
 
Please login to merge, or discard this patch.
src/Command/CheckDictionaries/CheckDictionariesCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
     {
19 19
         $this->setName('check:dictionaries')
20 20
             ->setDescription('Compare all dictionaries for all languages if there are all translation keys in all of them')
21
-            ->addArgument('config', InputArgument::REQUIRED, 'Path to config file. Instance of ' . CheckDictionariesConfig::class  . ' have to be returned')
21
+            ->addArgument('config', InputArgument::REQUIRED, 'Path to config file. Instance of '.CheckDictionariesConfig::class.' have to be returned')
22 22
             ->addOption('params', null, InputOption::VALUE_REQUIRED, 'Params for config in format --params="a=b&c=d"');
23 23
     }
24 24
 
25 25
     protected function execute(InputInterface $input, OutputInterface $output)
26 26
     {
27 27
         if (!is_file($input->getArgument('config'))) {
28
-            throw new InvalidArgumentException('File "' . $input->getArgument('config') . '" does not exist');
28
+            throw new InvalidArgumentException('File "'.$input->getArgument('config').'" does not exist');
29 29
         }
30 30
         parse_str($input->getOption('params'), $params);
31 31
         extract($params);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             throw $checkDictionariesConfig;
36 36
         }
37 37
         if (!$checkDictionariesConfig instanceof CheckDictionariesConfig) {
38
-            throw new InvalidConfigInstanceReturnedException('"' . (is_object($checkDictionariesConfig) ? get_class($checkDictionariesConfig) : $checkDictionariesConfig) . '" is not instance of ' . CheckDictionariesConfig::class);
38
+            throw new InvalidConfigInstanceReturnedException('"'.(is_object($checkDictionariesConfig) ? get_class($checkDictionariesConfig) : $checkDictionariesConfig).'" is not instance of '.CheckDictionariesConfig::class);
39 39
         }
40 40
 
41 41
         $output->writeln('');
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 }
51 51
                 $missingTranslations = array_diff(array_keys($dictionary1), array_keys($dictionary2));
52 52
                 foreach ($missingTranslations as $missingTranslation) {
53
-                    $errors[] = 'Missing translation for key ' . $missingTranslation . ' for language ' . $lang2;
53
+                    $errors[] = 'Missing translation for key '.$missingTranslation.' for language '.$lang2;
54 54
                 }
55 55
             }
56 56
         }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         }
62 62
 
63 63
         $output->writeln('');
64
-        $output->writeln('<comment>' . count($errors) . ' errors found</comment>');
64
+        $output->writeln('<comment>'.count($errors).' errors found</comment>');
65 65
         return count($errors);
66 66
     }
67 67
 }
Please login to merge, or discard this patch.