| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 16 | protected function fixPath( |
||
| 17 | string $applicationRootDirectory, |
||
| 18 | string $absoluteOrRelativePath, |
||
| 19 | string $baseFile |
||
| 20 | ): string { |
||
| 21 | $possiblyValidFiles = [ |
||
| 22 | $applicationRootDirectory . '/' . $absoluteOrRelativePath, |
||
| 23 | $this->makeAbsolutePath($baseFile, $absoluteOrRelativePath), |
||
| 24 | $absoluteOrRelativePath, |
||
| 25 | ]; |
||
| 26 | |||
| 27 | foreach ($possiblyValidFiles as $file) { |
||
| 28 | if (file_exists($file)) { |
||
| 29 | return $file; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | throw new InvalidReferencedPath($absoluteOrRelativePath, $possiblyValidFiles); |
||
| 34 | } |
||
| 35 | |||
| 50 |