| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 9 | public function decode(string $string): string |
|
| 22 | { |
||
| 23 | 9 | $decoded = []; |
|
| 24 | |||
| 25 | 9 | foreach (explode(DIRECTORY_SEPARATOR, $string) as $word) { |
|
| 26 | 9 | if (false === $this->isASafeString($word)) { |
|
| 27 | 6 | $word = urldecode($word); |
|
| 28 | } |
||
| 29 | |||
| 30 | 9 | $decoded[] = $word; |
|
| 31 | } |
||
| 32 | |||
| 33 | 9 | return implode(DIRECTORY_SEPARATOR, $decoded); |
|
| 34 | } |
||
| 56 |