summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-01-31 09:00:10 +0100
committerJulius Härtl <jus@bitgrid.net>2023-02-07 15:16:51 +0100
commita5a5a78ae19b48c773619e98be3990154ad0c9cc (patch)
treeed03a65d0b8b0eef52dbdfd94b57d194dc87ddf7
parenteef2cb855b053f9ae41dbd36685d9b49f81c6ee4 (diff)
downloadnextcloud-server-a5a5a78ae19b48c773619e98be3990154ad0c9cc.tar.gz
nextcloud-server-a5a5a78ae19b48c773619e98be3990154ad0c9cc.zip
chore: Add return types
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/files_sharing/lib/Controller/ShareInfoController.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareInfoController.php b/apps/files_sharing/lib/Controller/ShareInfoController.php
index ff5d208c1dc..0e2dd1667e1 100644
--- a/apps/files_sharing/lib/Controller/ShareInfoController.php
+++ b/apps/files_sharing/lib/Controller/ShareInfoController.php
@@ -59,11 +59,6 @@ class ShareInfoController extends ApiController {
* @PublicPage
* @NoCSRFRequired
* @BruteForceProtection(action=shareinfo)
- *
- * @param string $t
- * @param null $password
- * @param null $dir
- * @return JSONResponse
*/
public function info(string $t, ?string $password = null, ?string $dir = null, int $depth = -1): JSONResponse {
try {
@@ -99,18 +94,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 +123,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();