| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public static function realpath(string $path): string |
||
| 17 | { |
||
| 18 | $parts = explode('/', self::normalize($path)); |
||
| 19 | $out = []; |
||
| 20 | foreach ($parts as $part) { |
||
| 21 | if ($part === '.') { |
||
| 22 | continue; |
||
| 23 | } |
||
| 24 | if ($part === '..') { |
||
| 25 | array_pop($out); |
||
| 26 | continue; |
||
| 27 | } |
||
| 28 | $out[] = $part; |
||
| 29 | } |
||
| 30 | |||
| 31 | return implode('/', $out); |
||
| 32 | } |
||
| 45 |