| Total Complexity | 3 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class FilesystemUtils |
||
| 10 | { |
||
| 11 | const LIST_DIRECTORY_FILE_ONLY = 1; |
||
| 12 | const LIST_DIRECTORY_DIR_ONLY = 2; |
||
| 13 | const LIST_DIRECTORY_BOTH = 3; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Creates the completer $path with all missing intermediates directories. |
||
| 17 | * |
||
| 18 | * @param string $path |
||
| 19 | * |
||
| 20 | * @return bool |
||
| 21 | */ |
||
| 22 | public function createPath(string $path): bool |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Creates a symbolic $link pointing to $file. |
||
| 29 | * |
||
| 30 | * @param string $link |
||
| 31 | * @param string $file |
||
| 32 | * |
||
| 33 | * @return bool |
||
| 34 | */ |
||
| 35 | public function createSymlink(string $link, string $file): bool |
||
| 36 | { |
||
| 37 | return StaticFilesytemUtils::createSymlink($link, $file); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Gets filenames and folders names (according to $option) inside a $path. |
||
| 42 | * |
||
| 43 | * @param string $path |
||
| 44 | * @param int $option |
||
| 45 | * |
||
| 46 | * @return string[] |
||
| 47 | */ |
||
| 48 | public function listDirectory(string $path, int $option = self::LIST_DIRECTORY_BOTH): ?array |
||
| 51 | } |
||
| 52 | } |
||
| 53 |