| 1 | <?php |
||
| 10 | trait Paths |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Get the real path of a link or regular path if file is not a link. |
||
| 14 | * |
||
| 15 | * @param $file |
||
| 16 | * |
||
| 17 | * @return string |
||
| 18 | */ |
||
| 19 | private function getRealPath($file) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Get user home path. |
||
| 30 | * |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | public function getUserHomePath() |
||
| 45 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: