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