]> source.dussan.org Git - nextcloud-server.git/commitdiff
chore: Improve phpdoc typing to silence psalm errors 44622/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 28 Mar 2024 16:15:01 +0000 (17:15 +0100)
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>
Thu, 4 Apr 2024 09:45:22 +0000 (11:45 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
15 files changed:
apps/dav/lib/CardDAV/SyncService.php
apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
apps/dav/lib/Connector/Sabre/FilesPlugin.php
apps/dav/lib/HookManager.php
apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php
apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php
apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php
apps/files_external/lib/Lib/Auth/Password/UserProvided.php
apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
apps/files_external/lib/Lib/Auth/PublicKey/RSAPrivateKey.php
apps/files_external/lib/Lib/Backend/InvalidBackend.php
apps/files_external/lib/Lib/Backend/SMB.php
apps/files_external/lib/Lib/Backend/SMB_OC.php
apps/files_external/lib/Lib/StorageModifierTrait.php

index 52c8192a2fb2b5843213b8c39a89622b55f89fed..01747a9b10512e866deb01e2c75a0fd4c3b4b48f 100644 (file)
@@ -271,6 +271,9 @@ class SyncService {
                return $this->localSystemAddressBook;
        }
 
+       /**
+        * @return void
+        */
        public function syncInstance(?\Closure $progressCallback = null) {
                $systemAddressBook = $this->getLocalSystemAddressBook();
                $this->userManager->callForAllUsers(function ($user) use ($systemAddressBook, $progressCallback) {
index ce51a90eb27b676221f8755c7d8b80adaecc5cd5..83e01f290b872d8b4c8bdb4b9bf89da42b2ce64a 100644 (file)
@@ -29,6 +29,10 @@ namespace OCA\DAV\Connector\Sabre\Exception;
 use Exception;
 
 class FileLocked extends \Sabre\DAV\Exception {
+       /**
+        * @param string $message
+        * @param int $code
+        */
        public function __construct($message = "", $code = 0, ?Exception $previous = null) {
                if ($previous instanceof \OCP\Files\LockNotAcquiredException) {
                        $message = sprintf('Target file %s is locked by another process.', $previous->path);
index 73057dd76d1c2c3f25d3916d7681490caaad6989..7c9c7099878757a0b2dd2e94a4e8e70c89d7514b 100644 (file)
@@ -664,7 +664,8 @@ class FilesPlugin extends ServerPlugin {
 
        /**
         * @param string $filePath
-        * @param \Sabre\DAV\INode $node
+        * @param ?\Sabre\DAV\INode $node
+        * @return void
         * @throws \Sabre\DAV\Exception\BadRequest
         */
        public function sendFileIdHeader($filePath, ?\Sabre\DAV\INode $node = null) {
index f22e1ccf1640e9a873b791f3a203af5a1816553b..46cf9621f47749a7613363c7269ed5135d7298e5 100644 (file)
@@ -163,6 +163,9 @@ class HookManager {
                }
        }
 
+       /**
+        * @return void
+        */
        public function firstLogin(?IUser $user = null) {
                if (!is_null($user)) {
                        $principal = 'principals/users/' . $user->getUID();
index 9797a75d428fa760fe0b7ce58aab9b8a6463f73b..174efd96e3c293d9539826cc3a003b4fc2402b4d 100644 (file)
@@ -70,6 +70,9 @@ class GlobalAuth extends AuthMechanism {
                ]);
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
                        $uid = '';
index 5f4322814df04940a0824ebff8b3737048f1a8d9..5dc290d3548cdf67a2787583cf963ab7d4ffdd78 100644 (file)
@@ -112,6 +112,9 @@ class LoginCredentials extends AuthMechanism {
                return $credentials;
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                if (!isset($user)) {
                        throw new InsufficientDataForMeaningfulAnswerException('No login credentials saved');
index af781172c3506c7b376f420091c1c4bd28105652..d2587991a96e206af1b714c17defb4c91e0840b7 100644 (file)
@@ -51,6 +51,9 @@ class SessionCredentials extends AuthMechanism {
                        ->addParameters([]);
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                try {
                        $credentials = $this->credentialsStore->getLoginCredentials();
index 28457cf59de9dd4d1909ebeef94ca801e6f6dcc1..d43c4327b6ba5f52a5d79862689f8df73e42d1b4 100644 (file)
@@ -69,6 +69,9 @@ class UserGlobalAuth extends AuthMechanism {
                $this->credentialsManager->store($user->getUID(), self::CREDENTIALS_IDENTIFIER, $credentials);
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                if ($user === null) {
                        throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
index 2dd39e3a47d110bb58ca07cecaa26943e0581b3a..7fcbdb383368e84850d278ebd95fbbbe5b416bb7 100644 (file)
@@ -71,6 +71,9 @@ class UserProvided extends AuthMechanism implements IUserProvided {
                ]);
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                if (!isset($user)) {
                        throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
index 2c52f65480516881069a48a678f4fbbca8f1c842..67259ffc5b396008078daaaaf2e6394068d0ec73 100644 (file)
@@ -56,6 +56,9 @@ class RSA extends AuthMechanism {
                ;
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                $auth = new RSACrypt();
                $auth->setPassword($this->config->getSystemValue('secret', ''));
index bd6d87c22f8cb6e088484de7454140c43d240841..30ff5dd2a4c216aae6d67e281e503d993516acac 100644 (file)
@@ -54,6 +54,9 @@ class RSAPrivateKey extends AuthMechanism {
                        ]);
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                $auth = new RSACrypt();
                $auth->setPassword($this->config->getSystemValue('secret', ''));
index f9a0fd040ed386d3d78110f29b053aa146f98b9c..88c73470279367f5bf24c7eca9486e9dc4de9150 100644 (file)
@@ -60,6 +60,9 @@ class InvalidBackend extends Backend {
                return $this->invalidId;
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                $storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
        }
index 7fa2f3ae67af84c97b8ad7ea86dd9287e817ad32..29f6c727a1074e7090e5a6a88a1a7892ba057f2e 100644 (file)
@@ -77,6 +77,9 @@ class SMB extends Backend {
                        ->setLegacyAuthMechanism($legacyAuth);
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                $auth = $storage->getAuthMechanism();
                if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) {
index 33cb80c2bb58dd41df3f2a02ac6169ab8a32bc4c..5f1ed3b83348337d9f4a12d314cb43ffa85e525a 100644 (file)
@@ -60,6 +60,9 @@ class SMB_OC extends Backend {
                ;
        }
 
+       /**
+        * @return void
+        */
        public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) {
                $username_as_share = ($storage->getBackendOption('username_as_share') === true);
 
index 709539219fa501e2952ed0adf07d662735527eaf..096e091576eaa029266caffa682f43143fe186fe 100644 (file)
@@ -46,6 +46,7 @@ trait StorageModifierTrait {
         *
         * @param StorageConfig $storage
         * @param IUser $user User the storage is being used as
+        * @return void
         * @throws InsufficientDataForMeaningfulAnswerException
         * @throws StorageNotAvailableException
         */