Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function onReport($reportName, $report, $uri) {
// to user backends. I.e. the final result may return more results than requested.
$resultNodes = $this->processFilterRulesForFileNodes($filterRules, $limit ?? null, $offset ?? null);
} catch (TagNotFoundException $e) {
throw new PreconditionFailed('Cannot filter by non-existing tag', 0, $e);
throw new PreconditionFailed('Cannot filter by non-existing tag');
}

$results = [];
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/ServerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function createServer(
!$this->config->getSystemValue('debug', false)
)
);
$server->addPlugin(new QuotaPlugin($view, true));
$server->addPlugin(new QuotaPlugin($view));
$server->addPlugin(new ChecksumUpdatePlugin());

// Allow view-only plugin for webdav requests
Expand Down
2 changes: 1 addition & 1 deletion apps/encryption/lib/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function isReady() {
public function getPrivateKey() {
$key = $this->session->get('privateKey');
if (is_null($key)) {
throw new PrivateKeyMissingException('please try to log-out and log-in again', 0);
throw new PrivateKeyMissingException('please try to log-out and log-in again');
}
return $key;
}
Expand Down
1 change: 0 additions & 1 deletion apps/files_external/lib/Command/Verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ private function updateStorageStatus(StorageConfig &$storage, $configInput, Outp
MountConfig::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
false
)
);
} catch (InsufficientDataForMeaningfulAnswerException $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public function create(
* @param array $applicableUsers users for which to mount the storage
* @param array $applicableGroups groups for which to mount the storage
* @param int $priority priority
* @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*/
Expand All @@ -148,7 +147,6 @@ public function update(
$applicableUsers,
$applicableGroups,
$priority,
$testOnly = true,
) {
$storage = $this->createStorage(
$mountPoint,
Expand Down Expand Up @@ -181,7 +179,7 @@ public function update(
);
}

$this->updateStorageStatus($storage, $testOnly);
$this->updateStorageStatus($storage);

return new DataResponse(
$storage->jsonSerialize(true),
Expand Down
10 changes: 3 additions & 7 deletions apps/files_external/lib/Controller/StoragesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,8 @@ protected function manipulateStorageConfig(StorageConfig $storage) {
* on whether the remote storage is available or not.
*
* @param StorageConfig $storage storage configuration
* @param bool $testOnly whether to storage should only test the connection or do more things
*/
protected function updateStorageStatus(StorageConfig &$storage, $testOnly = true) {
protected function updateStorageStatus(StorageConfig &$storage) {
try {
$this->manipulateStorageConfig($storage);

Expand All @@ -226,8 +225,6 @@ protected function updateStorageStatus(StorageConfig &$storage, $testOnly = true
MountConfig::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
false,
$testOnly
)
);
} catch (InsufficientDataForMeaningfulAnswerException $e) {
Expand Down Expand Up @@ -268,15 +265,14 @@ public function index() {
* Get an external storage entry.
*
* @param int $id storage id
* @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*/
public function show(int $id, $testOnly = true) {
public function show(int $id) {
try {
$storage = $this->service->getStorage($id);

$this->updateStorageStatus($storage, $testOnly);
$this->updateStorageStatus($storage);
} catch (NotFoundException $e) {
return new DataResponse(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@ protected function manipulateStorageConfig(StorageConfig $storage) {
* Get an external storage entry.
*
* @param int $id storage id
* @param bool $testOnly whether to storage should only test the connection or do more things
* @return DataResponse
*/
#[NoAdminRequired]
public function show($id, $testOnly = true) {
public function show($id) {
try {
$storage = $this->service->getStorage($id);

$this->updateStorageStatus($storage, $testOnly);
$this->updateStorageStatus($storage);
} catch (NotFoundException $e) {
return new DataResponse(
[
Expand Down Expand Up @@ -133,7 +132,6 @@ public function show($id, $testOnly = true) {
*
* @param int $id storage id
* @param array $backendOptions backend-specific options
* @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*/
Expand All @@ -142,7 +140,6 @@ public function show($id, $testOnly = true) {
public function update(
$id,
$backendOptions,
$testOnly = true,
) {
try {
$storage = $this->service->getStorage($id);
Expand All @@ -167,7 +164,7 @@ public function update(
);
}

$this->updateStorageStatus($storage, $testOnly);
$this->updateStorageStatus($storage);
$this->sanitizeStorage($storage);

return new DataResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public function index() {
* {@inheritdoc}
*/
#[NoAdminRequired]
public function show(int $id, $testOnly = true) {
return parent::show($id, $testOnly);
public function show(int $id) {
return parent::show($id);
}

/**
Expand Down Expand Up @@ -152,7 +152,6 @@ public function create(
* @param string $authMechanism authentication mechanism identifier
* @param array $backendOptions backend-specific options
* @param array $mountOptions backend-specific mount options
* @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*/
Expand All @@ -165,7 +164,6 @@ public function update(
$authMechanism,
$backendOptions,
$mountOptions,
$testOnly = true,
) {
$storage = $this->createStorage(
$mountPoint,
Expand Down Expand Up @@ -195,7 +193,7 @@ public function update(
);
}

$this->updateStorageStatus($storage, $testOnly);
$this->updateStorageStatus($storage);

return new DataResponse(
$storage->jsonSerialize(true),
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/MountConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function substitutePlaceholdersInConfig($input, ?string $userId =
* @return int see self::STATUS_*
* @throws \Exception
*/
public static function getBackendStatus($class, $options, $isPersonal, $testOnly = true) {
public static function getBackendStatus($class, $options) {
if (self::$skipTest) {
return StorageNotAvailableException::STATUS_SUCCESS;
}
Expand All @@ -93,7 +93,7 @@ public static function getBackendStatus($class, $options, $isPersonal, $testOnly
$storage = new $class($options);

try {
$result = $storage->test($isPersonal, $testOnly);
$result = $storage->test();
$storage->setAvailability($result);
if ($result) {
return StorageNotAvailableException::STATUS_SUCCESS;
Expand Down
39 changes: 0 additions & 39 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,9 @@
</MoreSpecificReturnType>
</file>
<file src="apps/dav/lib/Connector/Sabre/FilesReportPlugin.php">
<InvalidArgument>
<code><![CDATA[0]]></code>
</InvalidArgument>
<InvalidNullableReturnType>
<code><![CDATA[bool]]></code>
</InvalidNullableReturnType>
<TooManyArguments>
<code><![CDATA[new PreconditionFailed('Cannot filter by non-existing tag', 0, $e)]]></code>
</TooManyArguments>
<UndefinedClass>
<code><![CDATA[Circles]]></code>
</UndefinedClass>
Expand Down Expand Up @@ -753,9 +747,6 @@
<code><![CDATA[getL10NFactory]]></code>
<code><![CDATA[getUserFolder]]></code>
</DeprecatedMethod>
<TooManyArguments>
<code><![CDATA[new QuotaPlugin($view, true)]]></code>
</TooManyArguments>
</file>
<file src="apps/dav/lib/Connector/Sabre/ShareTypeList.php">
<InvalidArgument>
Expand Down Expand Up @@ -1177,11 +1168,6 @@
<code><![CDATA[setAppValue]]></code>
</DeprecatedMethod>
</file>
<file src="apps/encryption/lib/Session.php">
<TooManyArguments>
<code><![CDATA[new PrivateKeyMissingException('please try to log-out and log-in again', 0)]]></code>
</TooManyArguments>
</file>
<file src="apps/encryption/lib/Settings/Admin.php">
<DeprecatedMethod>
<code><![CDATA[getAppValue]]></code>
Expand Down Expand Up @@ -1511,9 +1497,6 @@
<code><![CDATA[setIV]]></code>
<code><![CDATA[setKey]]></code>
</InternalMethod>
<TooManyArguments>
<code><![CDATA[test]]></code>
</TooManyArguments>
</file>
<file src="apps/files_external/lib/Service/BackendService.php">
<DeprecatedClass>
Expand Down Expand Up @@ -2901,9 +2884,6 @@
<FalsableReturnStatement>
<code><![CDATA[$this->appConfig->getValues($app, false)]]></code>
</FalsableReturnStatement>
<TooManyArguments>
<code><![CDATA[getFilteredValues]]></code>
</TooManyArguments>
</file>
<file src="core/Command/Db/AddMissingPrimaryKeys.php">
<DeprecatedMethod>
Expand Down Expand Up @@ -3314,11 +3294,6 @@
<code><![CDATA[$key]]></code>
</MoreSpecificImplementedParamType>
</file>
<file src="lib/private/App/AppStore/Fetcher/Fetcher.php">
<TooManyArguments>
<code><![CDATA[fetch]]></code>
</TooManyArguments>
</file>
<file src="lib/private/App/DependencyAnalyzer.php">
<InvalidNullableReturnType>
<code><![CDATA[bool]]></code>
Expand Down Expand Up @@ -3775,9 +3750,6 @@
<code><![CDATA[Mount\MountPoint[]]]></code>
<code><![CDATA[\OC\Files\Storage\Storage|null]]></code>
</MoreSpecificReturnType>
<TooManyArguments>
<code><![CDATA[addStorageWrapper]]></code>
</TooManyArguments>
</file>
<file src="lib/private/Files/Mount/MountPoint.php">
<UndefinedInterfaceMethod>
Expand Down Expand Up @@ -4071,11 +4043,6 @@
<code><![CDATA[getIncomplete]]></code>
</InvalidReturnType>
</file>
<file src="lib/private/Lockdown/Filesystem/NullStorage.php">
<TooManyArguments>
<code><![CDATA[new IteratorDirectory([])]]></code>
</TooManyArguments>
</file>
<file src="lib/private/Lockdown/LockdownManager.php">
<InvalidFunctionCall>
<code><![CDATA[$callback()]]></code>
Expand Down Expand Up @@ -4283,9 +4250,6 @@
<code><![CDATA[$share->getId()]]></code>
<code><![CDATA[(int)$data['id']]]></code>
</InvalidArgument>
<TooManyArguments>
<code><![CDATA[set]]></code>
</TooManyArguments>
<UndefinedInterfaceMethod>
<code><![CDATA[getParent]]></code>
</UndefinedInterfaceMethod>
Expand All @@ -4294,9 +4258,6 @@
<InvalidArgument>
<code><![CDATA[$id]]></code>
</InvalidArgument>
<TooManyArguments>
<code><![CDATA[update]]></code>
</TooManyArguments>
<UndefinedClass>
<code><![CDATA[\OCA\Circles\Api\v1\Circles]]></code>
</UndefinedClass>
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Config/ListConfigs.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function getSystemConfigs(bool $noSensitiveValues): array {
*/
protected function getAppConfigs(string $app, bool $noSensitiveValues) {
if ($noSensitiveValues) {
return $this->appConfig->getFilteredValues($app, false);
return $this->appConfig->getFilteredValues($app);
} else {
return $this->appConfig->getValues($app, false);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/App/AppStore/Fetcher/Fetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(
*
* @return array
*/
protected function fetch($ETag, $content) {
protected function fetch($ETag, $content, $allowUnstable = false) {
$appstoreenabled = $this->config->getSystemValueBool('appstoreenabled', true);
if ((int)$this->config->getAppValue('settings', 'appstore-fetcher-lastFailure', '0') > time() - self::RETRY_AFTER_FAILURE_SECONDS) {
return [];
Expand Down
5 changes: 4 additions & 1 deletion lib/private/Files/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace OC\Files;

use OC\Files\Mount\MountPoint;
use OC\Files\Storage\StorageFactory;
use OC\User\NoUserException;
use OCP\Cache\CappedMemoryCache;
use OCP\EventDispatcher\IEventDispatcher;
Expand Down Expand Up @@ -178,7 +179,9 @@ public static function addStorageWrapper($wrapperName, $wrapper, $priority = 50)
}

$mounts = self::getMountManager()->getAll();
if (!self::getLoader()->addStorageWrapper($wrapperName, $wrapper, $priority, $mounts)) {
/** @var StorageFactory $loader */
$loader = self::getLoader();
if (!$loader->addStorageWrapper($wrapperName, $wrapper, $priority, $mounts)) {
// do not re-wrap if storage with this name already existed
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Lockdown/Filesystem/NullStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function rmdir(string $path): never {
}

public function opendir(string $path): IteratorDirectory {
return new IteratorDirectory([]);
return new IteratorDirectory();
}

public function is_dir(string $path): bool {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Share20/DefaultShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function update(\OCP\Share\IShare $share) {
->set('expiration', $qb->createNamedParameter($expirationDate, IQueryBuilder::PARAM_DATETIME_MUTABLE))
->set('note', $qb->createNamedParameter($share->getNote()))
->set('label', $qb->createNamedParameter($share->getLabel()))
->set('hide_download', $qb->createNamedParameter($share->getHideDownload() ? 1 : 0), IQueryBuilder::PARAM_INT)
->set('hide_download', $qb->createNamedParameter($share->getHideDownload() ? 1 : 0, IQueryBuilder::PARAM_INT))
->executeStatement();
}

Expand Down
2 changes: 2 additions & 0 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OC\Share20\Exception\ProviderException;
use OCA\Files_Sharing\AppInfo\Application;
use OCA\Files_Sharing\SharedStorage;
use OCA\ShareByMail\ShareByMailProvider;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\File;
use OCP\Files\Folder;
Expand Down Expand Up @@ -869,6 +870,7 @@ public function updateShare(IShare $share, bool $onlyValid = true) {
// Now update the share!
$provider = $this->factory->getProviderForType($share->getShareType());
if ($share->getShareType() === IShare::TYPE_EMAIL) {
/** @var ShareByMailProvider $provider */
$share = $provider->update($share, $plainTextPassword);
} else {
$share = $provider->update($share);
Expand Down
Loading
Loading