| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 0 | ||
| 1 | <?php |
||
| 98 | 1 | public function decode(string $str = '', string $result = ''): string |
|
| 99 | { |
||
| 100 | 1 | if (empty($str) == true) { |
|
| 101 | return $this->decode($this->value); |
||
| 102 | } |
||
| 103 | |||
| 104 | 1 | $characters = array_flip($this->translation); |
|
| 105 | 1 | foreach (explode(' ', $str) as $character) { |
|
| 106 | 1 | if (isset($characters[$character])) { |
|
| 107 | 1 | $result .= $characters[$character]; |
|
| 108 | } |
||
| 109 | } |
||
| 110 | |||
| 111 | 1 | return $result; |
|
| 112 | } |
||
| 113 | } |
||
| 114 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.