| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class TranslationUtils |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Return the translation pattern with keys "{admin}" and "{key}" replaced by their values. |
||
| 9 | * |
||
| 10 | * @param string $translationPattern |
||
| 11 | * @param string $adminName |
||
| 12 | * @param string $key |
||
| 13 | * |
||
| 14 | * @return string |
||
| 15 | */ |
||
| 16 | public static function getTranslationKey( |
||
| 17 | string $translationPattern, |
||
| 18 | string $adminName, |
||
| 19 | string $key |
||
| 20 | ): string { |
||
| 21 | $translationPattern = str_replace('{key}', $key, $translationPattern); |
||
| 22 | $translationPattern = str_replace('{admin}', $adminName, $translationPattern); |
||
| 23 | |||
| 24 | return $translationPattern; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Return the translation pattern with keys "{admin}" and "{key}" replaced by their values. |
||
| 29 | * |
||
| 30 | * @param string $translationPattern |
||
| 31 | * @param string $adminName |
||
| 32 | * @param string $actionName |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | public static function getActionTranslationKey( |
||
| 45 | } |
||
| 46 | } |
||
| 47 |