Passed
Push — master ( 964728...4083d1 )
by Michal
09:14
created
src/TokenModifier/PrefixTranslationKeyTokenModifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
     protected function modify(Token $token): Token
18 18
     {
19
-        $token->changeTranslationKey($this->translationKeyPrefix . $token->getTranslationKey());
19
+        $token->changeTranslationKey($this->translationKeyPrefix.$token->getTranslationKey());
20 20
         return $token;
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
src/Bridge/KdybyTranslation/TokenModifier/ParamsExtractorTokenModifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         for ($i = 0; $i < $matchesCount; ++$i) {
28 28
             $paramName = $this->createParamName($matches[1][$i]);
29 29
             $paramValue = $this->createParamValue($matches[1][$i]);
30
-            $targetText = str_replace($matches[0][$i], '%' . $paramName . '%', $targetText);
30
+            $targetText = str_replace($matches[0][$i], '%'.$paramName.'%', $targetText);
31 31
             $textParameters[$paramName] = $paramValue;
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/composer_autoloader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function () {
3
+return function() {
4 4
     $files = [
5
-        __DIR__ . '/../../../autoload.php',  // composer dependency
6
-        __DIR__ . '/../vendor/autoload.php', // stand-alone package
5
+        __DIR__.'/../../../autoload.php', // composer dependency
6
+        __DIR__.'/../vendor/autoload.php', // stand-alone package
7 7
     ];
8 8
     foreach ($files as $file) {
9 9
         if (is_file($file)) {
Please login to merge, or discard this patch.
src/Bridge/KdybyTranslation/Storage/NeonFileStorage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         foreach ($texts as $key => $value) {
51 51
             if (!is_array($value)) {
52
-                $translations[$this->prefix . $key] = $value;
52
+                $translations[$this->prefix.$key] = $value;
53 53
                 continue;
54 54
             }
55 55
             $translations = $this->arrayToFlat($this->shiftArrayKey($value, $key), $translations);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $newTexts = [];
63 63
         foreach ($texts as $key => $value) {
64
-            $newTexts[$parentKey . '.' . $key] = $value;
64
+            $newTexts[$parentKey.'.'.$key] = $value;
65 65
         }
66 66
         return $newTexts;
67 67
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             return $translations;
75 75
         }
76 76
         if (isset($translations[$keyPart]) && is_string($translations[$keyPart])) {
77
-            $translations[$keyPart . '.' . implode('.', $translationKeyParts)] = $text;
77
+            $translations[$keyPart.'.'.implode('.', $translationKeyParts)] = $text;
78 78
             return $translations;
79 79
         }
80 80
         $translations[$keyPart] = $this->addToTranslations($translations[$keyPart] ?? [], $translationKeyParts, $text);
Please login to merge, or discard this patch.
src/Command/Translator/TranslatorCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $this->setName('translate')
18 18
             ->setDescription('Creates new language version of translated texts')
19
-            ->addArgument('config', InputArgument::REQUIRED, 'Path to config file. Instance of ' . TranslatorConfig::class  . ' have to be returned')
19
+            ->addArgument('config', InputArgument::REQUIRED, 'Path to config file. Instance of '.TranslatorConfig::class.' have to be returned')
20 20
             ->addOption('params', null, InputOption::VALUE_REQUIRED, 'Params for config in format a=b&c=d');
21 21
     }
22 22
 
23 23
     protected function execute(InputInterface $input, OutputInterface $output)
24 24
     {
25 25
         if (!is_file($input->getArgument('config'))) {
26
-            throw new InvalidArgumentException('File "' . $input->getArgument('config') . '" does not exist');
26
+            throw new InvalidArgumentException('File "'.$input->getArgument('config').'" does not exist');
27 27
         }
28 28
         parse_str($input->getOption('params'), $params);
29 29
         extract($params);
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             throw $translatorConfig;
34 34
         }
35 35
         if (!$translatorConfig instanceof TranslatorConfig) {
36
-            throw new InvalidConfigInstanceReturnedException('"' . (is_object($translatorConfig) ? get_class($translatorConfig) : $translatorConfig) . '" is not instance of ' . TranslatorConfig::class);
36
+            throw new InvalidConfigInstanceReturnedException('"'.(is_object($translatorConfig) ? get_class($translatorConfig) : $translatorConfig).'" is not instance of '.TranslatorConfig::class);
37 37
         }
38 38
 
39 39
         $translatorConfig->translate();
Please login to merge, or discard this patch.
src/TokenModifier/FilePathToKeyTokenModifier.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
 
20 20
     public function modifyAll(TokenCollection $tokenCollection): TokenCollection
21 21
     {
22
-        $pathParts = array_unique(explode('/', str_replace($this->basePath . '/', '', pathinfo($tokenCollection->getFilePath(), PATHINFO_DIRNAME) . '/' . pathinfo($tokenCollection->getFilePath(), PATHINFO_FILENAME))));
22
+        $pathParts = array_unique(explode('/', str_replace($this->basePath.'/', '', pathinfo($tokenCollection->getFilePath(), PATHINFO_DIRNAME).'/'.pathinfo($tokenCollection->getFilePath(), PATHINFO_FILENAME))));
23 23
         foreach ($tokenCollection->getTokens() as $token) {
24
-            $newKeyParts = array_filter(array_map([$this, 'toUnderscore'], $pathParts), function ($pathPart) {
24
+            $newKeyParts = array_filter(array_map([$this, 'toUnderscore'], $pathParts), function($pathPart) {
25 25
                 return !in_array($pathPart, $this->excludeDirectoryNames);
26 26
             });
27 27
             $newKeyParts[] = $token->getTranslationKey();
Please login to merge, or discard this patch.
src/TokenModifier/VariableNameModifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     {
12 12
         preg_match('#\$(.*?)=#', $token->getOriginalBlock(), $matches);
13 13
         if (!isset($matches[1])) {
14
-            throw new Exception('Cannot find variable name in ' . $token->getOriginalBlock());
14
+            throw new Exception('Cannot find variable name in '.$token->getOriginalBlock());
15 15
         }
16 16
         $token->changeTranslationKey(trim($matches[1]));
17 17
         return $token;
Please login to merge, or discard this patch.
config_examples/Extractor/Nette/latte_kdyby_one_file_saver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
 use Efabrica\TranslationsAutomatization\TokenModifier\PrefixTranslationKeyTokenModifier;
16 16
 
17 17
 $basePath = rtrim($basePath, '/');
18
-$storage = new NeonFileStorage($basePath . '/app/lang/dictionary.sk_SK.neon', '    ');
18
+$storage = new NeonFileStorage($basePath.'/app/lang/dictionary.sk_SK.neon', '    ');
19 19
 $saver = new OneFileTranslationSaver($storage);
20 20
 $extractorConfig = new ExtractorConfig($saver);
21 21
 
22
-$fileFinder = new FileFinder([$basePath . '/app'], ['latte']);
22
+$fileFinder = new FileFinder([$basePath.'/app'], ['latte']);
23 23
 
24 24
 $textFinder = new RegexTextFinder();
25 25
 $textFinder->addPattern('/\{\_(.*?)\}/', null);
Please login to merge, or discard this patch.
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.