From 03b969fb9597ae86564ad5f8a83d6fd64bd1d65a Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 16 Sep 2024 20:29:48 +0200 Subject: [PATCH] chore: Improve typing and phpdoc comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/dav/tests/unit/Connector/Sabre/FileTest.php | 10 ++-------- apps/files_trashbin/lib/Trashbin.php | 5 +++-- lib/public/Files/Storage/IStorage.php | 3 ++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 07128a1c7af..55a6783225d 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -72,10 +72,7 @@ class FileTest extends TestCase { parent::tearDown(); } - /** - * @return MockObject|IStorage - */ - private function getMockStorage() { + private function getMockStorage(): MockObject&IStorage { $storage = $this->getMockBuilder(IStorage::class) ->disableOriginalConstructor() ->getMock(); @@ -84,10 +81,7 @@ class FileTest extends TestCase { return $storage; } - /** - * @param string $string - */ - private function getStream($string) { + private function getStream(string $string) { $stream = fopen('php://temp', 'r+'); fwrite($stream, $string); fseek($stream, 0); diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index b83a81972e1..544bc877d70 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -140,6 +140,7 @@ class Trashbin { } } + /** @param string $user */ private static function setUpTrash($user): void { $view = new View('/' . $user); if (!$view->is_dir('files_trashbin')) { @@ -163,10 +164,10 @@ class Trashbin { * @param string $sourcePath * @param string $owner * @param string $targetPath - * @param $user + * @param string $user * @param int $timestamp */ - private static function copyFilesToUser($sourcePath, $owner, $targetPath, $user, $timestamp) { + private static function copyFilesToUser($sourcePath, $owner, $targetPath, $user, $timestamp): void { self::setUpTrash($owner); $targetFilename = basename($targetPath); diff --git a/lib/public/Files/Storage/IStorage.php b/lib/public/Files/Storage/IStorage.php index e009f2b6fae..d2fd3b75553 100644 --- a/lib/public/Files/Storage/IStorage.php +++ b/lib/public/Files/Storage/IStorage.php @@ -407,7 +407,8 @@ interface IStorage { /** * @since 12.0.0 - * @return mixed + * @since 31.0.0 moved from Storage to IStorage + * @return bool */ public function needsPartFile(); -- 2.39.5