| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function resolve($path) |
||
| 38 | { |
||
| 39 | $allowedPaths = [ |
||
| 40 | $this->rootDir, |
||
| 41 | $this->rootDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' |
||
| 42 | ]; |
||
| 43 | |||
| 44 | foreach ($allowedPaths as $allowedPath) { |
||
| 45 | $absolutePath = $allowedPath . DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR); |
||
| 46 | if (file_exists($absolutePath)) { |
||
| 47 | return $absolutePath; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | throw new ConfigurationException(sprintf('Config "%s" was not found.', $path)); |
||
| 52 | } |
||
| 53 | } |
||
| 54 |