Passed
Push — master ( 9db0c6...cf0e90 )
by Michal
18:17 queued 01:02
created
config_examples/CheckDictionaries/config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 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 21
 $files = Finder::create()->in($translationDirs);
22 22
 $dictionaryStorages = [];
23 23
 foreach ($files as $file) {
24
-    $filePath = (string)$file;
24
+    $filePath = (string) $file;
25 25
     $info = pathinfo($filePath);
26 26
     list($prefix, $lang,) = explode('.', $info['basename'], 3);
27
-    $dictionaryStorages[$lang][$info['dirname'] . '/' . $prefix] = new NeonFileStorage($filePath, $prefix . '.', '    ');
27
+    $dictionaryStorages[$lang][$info['dirname'].'/'.$prefix] = new NeonFileStorage($filePath, $prefix.'.', '    ');
28 28
 }
29 29
 
30 30
 foreach ($fallbacks ?? [] as $lang => $fallbackLangs) {
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('');
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             foreach ($dictionaries as $lang2 => $dictionary2) {
48 48
                 $missingTranslations = array_diff(array_keys($dictionary1), array_keys($dictionary2));
49 49
                 foreach ($missingTranslations as $missingTranslation) {
50
-                    $errors[] = 'Missing translation for key ' . $missingTranslation . ' for language ' . $lang2;
50
+                    $errors[] = 'Missing translation for key '.$missingTranslation.' for language '.$lang2;
51 51
                 }
52 52
             }
53 53
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         }
59 59
 
60 60
         $output->writeln("\n");
61
-        $output->writeln('<comment>' . count($errors) . ' errors found</comment>');
61
+        $output->writeln('<comment>'.count($errors).' errors found</comment>');
62 62
         return count($errors);
63 63
     }
64 64
 }
Please login to merge, or discard this patch.