Completed
Pull Request — master (#16)
by Michal
05:39 queued 04:00
created
src/TokenModifier/FilePathToKeyTokenModifier.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 
19 19
     public function modifyAll(TokenCollection $tokenCollection): TokenCollection
20 20
     {
21
-        $pathParts = explode('/', str_replace($this->basePath . '/', '', $tokenCollection->getFilePath()));
21
+        $pathParts = explode('/', str_replace($this->basePath.'/', '', $tokenCollection->getFilePath()));
22 22
         array_pop($pathParts);
23 23
         foreach ($tokenCollection->getTokens() as $token) {
24
-            $newKeyParts = array_filter(array_map('strtolower', $pathParts), function ($pathPart) {
24
+            $newKeyParts = array_filter(array_map('strtolower', $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/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.
examples/Nette/latte_kdyby_one_file_saver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
 use Efabrica\TranslationsAutomatization\TokenModifier\PrefixTranslationKeyTokenModifier;
15 15
 use Efabrica\TranslationsAutomatization\TranslationFinder;
16 16
 
17
-require_once __DIR__ . '/../../vendor/autoload.php';
17
+require_once __DIR__.'/../../vendor/autoload.php';
18 18
 
19 19
 $basePath = rtrim($argv[1] ?? __DIR__, '/');
20 20
 
21
-$storage = new NeonFileStorage($basePath . '/app/lang/dictionary.sk_SK.neon', '    ');
21
+$storage = new NeonFileStorage($basePath.'/app/lang/dictionary.sk_SK.neon', '    ');
22 22
 $saver = new OneFileTranslationSaver($storage);
23 23
 $translationFinder = new TranslationFinder($saver);
24 24
 
25
-$fileFinder = new FileFinder([$basePath . '/app'], ['latte']);
25
+$fileFinder = new FileFinder([$basePath.'/app'], ['latte']);
26 26
 
27 27
 $textFinder = new RegexTextFinder();
28 28
 
Please login to merge, or discard this patch.
src/Bridge/KdybyTranslation/Storage/NeonFileStorage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $newTexts = [];
59 59
         foreach ($texts as $key => $value) {
60
-            $newTexts[$parentKey . '.' . $key] = $value;
60
+            $newTexts[$parentKey.'.'.$key] = $value;
61 61
         }
62 62
         return $newTexts;
63 63
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             return $translations;
71 71
         }
72 72
         if (isset($translations[$keyPart]) && is_string($translations[$keyPart])) {
73
-            $translations[$keyPart . '.' . implode('.', $translationKeyParts)] = $text;
73
+            $translations[$keyPart.'.'.implode('.', $translationKeyParts)] = $text;
74 74
             return $translations;
75 75
         }
76 76
         $translations[$keyPart] = $this->addToTranslations($translations[$keyPart] ?? [], $translationKeyParts, $text);
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.