| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function getAbsoluteDirectory(): string |
||
| 20 | { |
||
| 21 | $viewPath = str_replace('.', '/', $this->viewDirectory); |
||
| 22 | |||
| 23 | $absoluteDirectory = collect(View::getFinder()->getPaths()) |
||
| 24 | ->map(function(string $path) use ($viewPath) { |
||
| 25 | return realpath($path . '/' . $viewPath); |
||
| 26 | }) |
||
| 27 | ->filter() |
||
| 28 | ->first(); |
||
| 29 | |||
| 30 | if (! $absoluteDirectory) { |
||
| 31 | throw CouldNotRegisterComponent::viewPathNotFound($viewPath); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $absoluteDirectory; |
||
| 35 | } |
||
| 36 | |||
| 43 | } |