| Conditions | 6 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function toAbsolutePath(string $path, string $configurationPath): string |
||
| 16 | { |
||
| 17 | $path = \trim($path); |
||
| 18 | |||
| 19 | if (0 === \strpos($path, '/')) { |
||
| 20 | return $path; |
||
| 21 | } |
||
| 22 | |||
| 23 | if ('\\' === $path[0] || (\strlen($path) >= 3 && \preg_match('#^[A-Z]\:[/\\\]#i', \substr($path, 0, 3)))) { |
||
| 24 | return $path; |
||
| 25 | } |
||
| 26 | |||
| 27 | if (false !== \strpos($path, '://')) { |
||
| 28 | return $path; |
||
| 29 | } |
||
| 30 | |||
| 31 | return \dirname($configurationPath) . '/' . $path; |
||
| 32 | } |
||
| 34 |