Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
85 | public function encode(string $str = '', string $result = ''): string |
||
86 | { |
||
87 | if (empty($str) === true) { |
||
88 | return $this->encode($this->value); |
||
89 | } |
||
90 | |||
91 | foreach (str_split($str) as $char) { |
||
92 | if (isset($this->translation[$char])) { |
||
93 | $result .= " ".$this->translation[$char]; |
||
94 | } |
||
95 | } |
||
96 | |||
97 | return trim($result); |
||
98 | } |
||
99 | |||
123 |