diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-01-31 09:00:10 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-01-31 11:42:33 +0100 |
commit | 7e3ea019d1c9f8eb5486de802f04be194c4d1f2e (patch) | |
tree | 6124caaabff8192cdab347e79a9c57f3645ac508 /apps/files_sharing/lib | |
parent | 7cc9ba28a7e221e7e9f3723f3a6fb51ad57ea152 (diff) | |
download | nextcloud-server-7e3ea019d1c9f8eb5486de802f04be194c4d1f2e.tar.gz nextcloud-server-7e3ea019d1c9f8eb5486de802f04be194c4d1f2e.zip |
chore: Add return types
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareInfoController.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareInfoController.php b/apps/files_sharing/lib/Controller/ShareInfoController.php index 2b8373af1cd..b6242f9ee9a 100644 --- a/apps/files_sharing/lib/Controller/ShareInfoController.php +++ b/apps/files_sharing/lib/Controller/ShareInfoController.php @@ -65,7 +65,7 @@ class ShareInfoController extends ApiController { * @param ?string $dir * @return JSONResponse */ - public function info(string $t, ?string $password = null, ?string $dir = null, int $depth = -1) { + public function info(string $t, ?string $password = null, ?string $dir = null, int $depth = -1): JSONResponse { try { $share = $this->shareManager->getShareByToken($t); } catch (ShareNotFound $e) { @@ -99,18 +99,19 @@ class ShareInfoController extends ApiController { return new JSONResponse($this->parseNode($node, $permissionMask, $depth)); } - private function parseNode(Node $node, int $permissionMask, int $depth) { + private function parseNode(Node $node, int $permissionMask, int $depth): array { if ($node instanceof File) { return $this->parseFile($node, $permissionMask); } + /** @var Folder $node */ return $this->parseFolder($node, $permissionMask, $depth); } - private function parseFile(File $file, int $permissionMask) { + private function parseFile(File $file, int $permissionMask): array { return $this->format($file, $permissionMask); } - private function parseFolder(Folder $folder, int $permissionMask, int $depth) { + private function parseFolder(Folder $folder, int $permissionMask, int $depth): array { $data = $this->format($folder, $permissionMask); if ($depth === 0) { @@ -127,7 +128,7 @@ class ShareInfoController extends ApiController { return $data; } - private function format(Node $node, int $permissionMask) { + private function format(Node $node, int $permissionMask): array { $entry = []; $entry['id'] = $node->getId(); |