diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index 784980c94..f334edfee 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -16,6 +16,7 @@ namespace phpOMS\System\File\Local; use phpOMS\System\File\DirectoryInterface; +use phpOMS\System\File\PathException; use phpOMS\Utils\StringUtils; /** @@ -190,7 +191,7 @@ class Directory extends FileAbstract implements DirectoryInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public static function deletePath($path) : bool + public static function delete(string $path) : bool { $path = realpath($oldPath = $path); if ($path === false || !is_dir($path) || StringUtils::startsWith($path, ROOT_PATH)) { @@ -205,7 +206,7 @@ class Directory extends FileAbstract implements DirectoryInterface foreach ($files as $file) { if (is_dir($file)) { - self::deletePath($file); + self::delete($file); } else { unlink($file); } @@ -256,11 +257,6 @@ class Directory extends FileAbstract implements DirectoryInterface /* Iterator */ - public static function delete(string $path) : bool - { - // TODO: Implement delete() method. - } - public static function copy(string $from, string $to, bool $overwrite = false) : bool { // TODO: Implement copy() method. diff --git a/System/File/Local/File.php b/System/File/Local/File.php index c7b59f92c..e52f628bd 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -15,6 +15,7 @@ */ namespace phpOMS\System\File\Local; use phpOMS\System\File\FileInterface; +use phpOMS\System\File\PathException; /** * Filesystem class.