Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | protected function modify(Token $token): Token |
||
11 | { |
||
12 | preg_match('#\$(.*?)=#', $token->getOriginalBlock(), $matches); |
||
13 | if (!isset($matches[1])) { |
||
14 | throw new Exception('Cannot find variable name in ' . $token->getOriginalBlock()); |
||
15 | } |
||
16 | $token->changeTranslationKey(trim($matches[1])); |
||
17 | return $token; |
||
18 | } |
||
20 |