Conditions | 4 |
Paths | 4 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function getDocumentRoot($path) :string |
||
19 | { |
||
20 | $path = is_string($path) ? realpath($path) : realpath('.'); |
||
21 | |||
22 | if ($path === false || !is_dir($path)) { |
||
23 | throw new LogicException('The given path is not a directory or directory is not exists.'); |
||
24 | } |
||
25 | |||
26 | return $path; |
||
27 | } |
||
28 | } |
||
29 |