diff options
Diffstat (limited to 'lib/private/Files/Storage/PolyFill/CopyDirectory.php')
-rw-r--r-- | lib/private/Files/Storage/PolyFill/CopyDirectory.php | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/private/Files/Storage/PolyFill/CopyDirectory.php b/lib/private/Files/Storage/PolyFill/CopyDirectory.php index 5fe396d97e1..19833a57348 100644 --- a/lib/private/Files/Storage/PolyFill/CopyDirectory.php +++ b/lib/private/Files/Storage/PolyFill/CopyDirectory.php @@ -12,31 +12,28 @@ trait CopyDirectory { * Check if a path is a directory * * @param string $path - * @return bool */ - abstract public function is_dir($path); + abstract public function is_dir($path): bool; /** * Check if a file or folder exists * * @param string $path - * @return bool */ - abstract public function file_exists($path); + abstract public function file_exists($path): bool; /** * Delete a file or folder * * @param string $path - * @return bool */ - abstract public function unlink($path); + abstract public function unlink($path): bool; /** * Open a directory handle for a folder * * @param string $path - * @return resource | bool + * @return resource|false */ abstract public function opendir($path); @@ -44,11 +41,10 @@ trait CopyDirectory { * Create a new folder * * @param string $path - * @return bool */ - abstract public function mkdir($path); + abstract public function mkdir($path): bool; - public function copy($source, $target) { + public function copy($source, $target): bool { if ($this->is_dir($source)) { if ($this->file_exists($target)) { $this->unlink($target); @@ -62,12 +58,8 @@ trait CopyDirectory { /** * For adapters that don't support copying folders natively - * - * @param $source - * @param $target - * @return bool */ - protected function copyRecursive($source, $target) { + protected function copyRecursive($source, $target): bool { $dh = $this->opendir($source); $result = true; while (($file = readdir($dh)) !== false) { |