Browse Source

chore: Improve phpdoc typing to silence psalm errors

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/44534/head
Côme Chilliet 2 months ago
parent
commit
81319e78bf

+ 3
- 0
apps/dav/lib/CardDAV/SyncService.php View 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) {

+ 4
- 0
apps/dav/lib/Connector/Sabre/Exception/FileLocked.php View 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);

+ 2
- 1
apps/dav/lib/Connector/Sabre/FilesPlugin.php View 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) {

+ 3
- 0
apps/dav/lib/HookManager.php View File

@@ -163,6 +163,9 @@ class HookManager {
}
}

/**
* @return void
*/
public function firstLogin(?IUser $user = null) {
if (!is_null($user)) {
$principal = 'principals/users/' . $user->getUID();

+ 3
- 0
apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php View 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 = '';

+ 3
- 0
apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php View 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');

+ 3
- 0
apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php View 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();

+ 3
- 0
apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php View 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');

+ 3
- 0
apps/files_external/lib/Lib/Auth/Password/UserProvided.php View 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');

+ 3
- 0
apps/files_external/lib/Lib/Auth/PublicKey/RSA.php View 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', ''));

+ 3
- 0
apps/files_external/lib/Lib/Auth/PublicKey/RSAPrivateKey.php View 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', ''));

+ 3
- 0
apps/files_external/lib/Lib/Backend/InvalidBackend.php View 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));
}

+ 3
- 0
apps/files_external/lib/Lib/Backend/SMB.php View 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) {

+ 3
- 0
apps/files_external/lib/Lib/Backend/SMB_OC.php View 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);


+ 1
- 0
apps/files_external/lib/Lib/StorageModifierTrait.php View 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
*/

Loading…
Cancel
Save