diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-10-17 12:40:35 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-10-17 12:40:35 +0200 |
commit | 54031e370ac05b127d4bc799de99ce1b643adcbb (patch) | |
tree | 36d71151c54c260fbefffdf6ed137862e922b74a /apps | |
parent | 0a2a4d86870f9738544c67cc494c3f48a8f4e924 (diff) | |
download | nextcloud-server-54031e370ac05b127d4bc799de99ce1b643adcbb.tar.gz nextcloud-server-54031e370ac05b127d4bc799de99ce1b643adcbb.zip |
Fix various other small psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Cache.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php | 11 | ||||
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/External/Manager.php | 7 | ||||
-rw-r--r-- | apps/files_sharing/lib/External/Mount.php | 5 |
5 files changed, 9 insertions, 18 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index aa45b6ab43e..b99a511312e 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -109,7 +109,7 @@ class Cache extends CacheJail { if (isset($this->numericId)) { return $this->numericId; } else { - return false; + return -1; } } diff --git a/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php b/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php index 28d0d26c5be..2fd35b20a0f 100644 --- a/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php +++ b/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php @@ -32,12 +32,9 @@ use OCP\Share\IManager; class ShareRecipientSorter implements ISorter { - /** @var IManager */ - private $shareManager; - /** @var Folder */ - private $rootFolder; - /** @var IUserSession */ - private $userSession; + private IManager $shareManager; + private IRootFolder $rootFolder; + private IUserSession $userSession; public function __construct(IManager $shareManager, IRootFolder $rootFolder, IUserSession $userSession) { $this->shareManager = $shareManager; @@ -45,7 +42,7 @@ class ShareRecipientSorter implements ISorter { $this->userSession = $userSession; } - public function getId() { + public function getId(): string { return 'share-recipients'; } diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 4a9ace47146..6a6fd1c9f7f 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -429,7 +429,7 @@ class ShareController extends AuthPublicShareController { */ $freeSpace = $share->getNode()->getStorage()->free_space($share->getNode()->getInternalPath()); if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) { - $freeSpace = max($freeSpace, 0); + $freeSpace = (int)max($freeSpace, 0); } else { $freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 } diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index b9ed4acd57f..68bc6801e46 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -447,14 +447,11 @@ class Manager { return $result; } - /** - * @param int $remoteShare - */ - public function processNotification($remoteShare) { + public function processNotification(int $remoteShare): void { $filter = $this->notificationManager->createNotification(); $filter->setApp('files_sharing') ->setUser($this->uid) - ->setObject('remote_share', (int) $remoteShare); + ->setObject('remote_share', (string)$remoteShare); $this->notificationManager->markProcessed($filter); } diff --git a/apps/files_sharing/lib/External/Mount.php b/apps/files_sharing/lib/External/Mount.php index 2047dede39b..ccd31147f26 100644 --- a/apps/files_sharing/lib/External/Mount.php +++ b/apps/files_sharing/lib/External/Mount.php @@ -61,11 +61,8 @@ class Mount extends MountPoint implements MoveableMount { /** * Remove the mount points - * - * @return mixed - * @return bool */ - public function removeMount() { + public function removeMount(): bool { return $this->manager->removeShare($this->mountPoint); } |