Conditions | 6 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
77 | private function buildPathByAuthority(string $path, string $authority): string |
||
78 | { |
||
79 | $newPath = $path; |
||
80 | |||
81 | if ('/' !== $path[0]) { |
||
82 | if ('' !== $authority) { |
||
83 | $newPath = '/' . $path; |
||
84 | } |
||
85 | } elseif (isset($path[1]) and '/' === $path[1]) { |
||
86 | if ('' === $authority) { |
||
87 | $newPath = '/' . ltrim($path, '/'); |
||
88 | } |
||
89 | } |
||
90 | |||
91 | return $newPath; |
||
92 | } |
||
93 | } |