| Total Complexity | 11 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Path |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Platform agnostic absolute path detection. |
||
| 9 | * |
||
| 10 | * @param string $path |
||
| 11 | * |
||
| 12 | * @return bool |
||
| 13 | */ |
||
| 14 | public function isAbsolute($path) |
||
| 21 | } |
||
| 22 | |||
| 23 | public function getRelativePath($fullPath, $basePath) |
||
| 31 | } |
||
| 32 | |||
| 33 | public function ensureDir($dir) |
||
| 34 | { |
||
| 35 | if (!\is_dir($dir)) { |
||
| 36 | \mkdir($dir, 0777, true); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getExtension($filePath) |
||
| 41 | { |
||
| 42 | return pathinfo($filePath, PATHINFO_EXTENSION); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function readAsJson($filePath, $asArray = true) |
||
|
|
|||
| 46 | { |
||
| 47 | return json_decode(file_get_contents($filePath), true) ?: []; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function writeFile($file, $content, $mode = null) |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.