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