Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
107 | public function decode(string $str = '', string $result = ''): string |
||
108 | { |
||
109 | if (empty($str) === true) { |
||
110 | return $this->decode($this->value); |
||
111 | } |
||
112 | |||
113 | $characters = array_flip($this->translation); |
||
114 | foreach (explode(' ', $str) as $character) { |
||
115 | if (isset($characters[$character])) { |
||
116 | $result .= $characters[$character]; |
||
117 | } |
||
118 | } |
||
119 | |||
120 | return $result; |
||
121 | } |
||
122 | } |
||
123 |