| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | 6 | private function normalize(string $path): string |
|
| 48 | { |
||
| 49 | 6 | $slash = '/'; |
|
| 50 | |||
| 51 | 6 | if ('' === $path) { |
|
| 52 | 2 | return $slash; |
|
| 53 | } |
||
| 54 | |||
| 55 | 4 | if (1 < strlen($path)) { |
|
| 56 | 4 | $extension = pathinfo($path, PATHINFO_EXTENSION); |
|
| 57 | 4 | if ($slash !== substr($path, -1) && '' === $extension) { |
|
| 58 | 2 | return $path . $slash; |
|
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | 2 | return $path; |
|
| 63 | } |
||
| 65 |