@@ -19,9 +19,9 @@ |
||
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(); |
@@ -11,7 +11,7 @@ |
||
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; |