Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | static function absolutizePath($path) |
||
|
|||
26 | { |
||
27 | |||
28 | $path = realpath($path); |
||
29 | if(!$path) { |
||
30 | // TODO: use hack like http://stackoverflow.com/questions/4049856/replace-phps-realpath or http://www.php.net/manual/en/function.realpath.php#84012 |
||
31 | // probably as optional feature that can be turned on when you know, what are you doing |
||
32 | |||
33 | throw new Exception("Not possible to resolve absolute path."); |
||
34 | } |
||
35 | return $path; |
||
36 | } |
||
37 | |||
54 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.