@@ -18,10 +18,10 @@ |
||
| 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(); |
@@ -16,7 +16,7 @@ |
||
| 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 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $paramName = $this->createParamName($matches[1][$i]); |
| 30 | 30 | $paramValue = $this->createParamValue($matches[1][$i]); |
| 31 | 31 | |
| 32 | - $targetText = str_replace($matches[0][$i], '%' . $paramName . '%', $targetText); |
|
| 32 | + $targetText = str_replace($matches[0][$i], '%'.$paramName.'%', $targetText); |
|
| 33 | 33 | if ($token->getTargetText() === $token->getTranslationKey()) { |
| 34 | 34 | $translationKey = $targetText; |
| 35 | 35 | } |
@@ -14,15 +14,15 @@ |
||
| 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 | |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | foreach ($subnode as $key => $value) { |
| 51 | 51 | if (is_array($value)) { |
| 52 | - $nodePath = $path ? $path . '.' . $key : $key; |
|
| 52 | + $nodePath = $path ? $path.'.'.$key : $key; |
|
| 53 | 53 | $this->flatten($translations, $value, $nodePath); |
| 54 | 54 | if ($path === null) { |
| 55 | 55 | unset($translations[$key]); |
| 56 | 56 | } |
| 57 | 57 | } elseif ($path !== null) { |
| 58 | - $translations[$path . '.' . $key] = $value; |
|
| 58 | + $translations[$path.'.'.$key] = $value; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | return $translations; |
| 69 | 69 | } |
| 70 | 70 | if (isset($translations[$keyPart]) && is_string($translations[$keyPart])) { |
| 71 | - $translations[$keyPart . '.' . implode('.', $translationKeyParts)] = $text; |
|
| 71 | + $translations[$keyPart.'.'.implode('.', $translationKeyParts)] = $text; |
|
| 72 | 72 | return $translations; |
| 73 | 73 | } |
| 74 | 74 | if (!isset($translations[$keyPart])) { |