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