Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
54 | private function translateFormat(string $formatString) : string |
||
55 | { |
||
56 | $chars = ConvertHelper::string2array($formatString); |
||
57 | $result = array(); |
||
58 | |||
59 | foreach($chars as $char) |
||
60 | { |
||
61 | if(!isset($this->charTable[$char])) |
||
62 | { |
||
63 | throw new Mailcode_Translator_Exception( |
||
64 | 'Unknown date format string character', |
||
65 | sprintf( |
||
66 | 'No translation for character %s available.', |
||
67 | ConvertHelper::hidden2visible($char) |
||
68 | ), |
||
69 | self::ERROR_UNKNOWN_DATE_FORMAT_CHARACTER |
||
70 | ); |
||
71 | |||
72 | } |
||
73 | |||
74 | $result[] = $this->charTable[$char]; |
||
75 | } |
||
76 | |||
77 | return implode('', $result); |
||
78 | } |
||
80 |