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