diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-08-09 20:32:21 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-08-12 11:58:50 +0400 |
commit | 3e625413e3b6901282222f96a4e48ce953b07c68 (patch) | |
tree | 9850d68bf9ba78f4d1e1c2086f664b155f3901d0 /core | |
parent | 24e75d7cb99964a3886d3b33356806c210783b6f (diff) |
refs #5936 added some phpdoc blocks
Diffstat (limited to 'core')
-rw-r--r-- | core/Filesystem.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/Filesystem.php b/core/Filesystem.php index cfa0c336db..637564255e 100644 --- a/core/Filesystem.php +++ b/core/Filesystem.php @@ -219,13 +219,21 @@ class Filesystem $remove = $target . $file; if (is_dir($remove)) { - rmdir($remove); + @rmdir($remove); } else { self::deleteFileIfExists($remove); } } } + /** + * Sort all given paths/filenames by its path length. Long path names will be listed first. This method can be + * useful if you have for instance a bunch of files/directories to delete. By sorting them by lengh you can make + * sure to delete all files within the folders before deleting the actual folder. + * + * @param string[] $files + * @return string[] + */ public static function sortFilesDescByPathLength($files) { usort($files, function ($a, $b) { @@ -247,7 +255,7 @@ class Filesystem * @param $source * @param $target * - * @return array + * @return string[] */ public static function directoryDiff($source, $target) { |