From e095633c72234114825caa175b98c7923d07f118 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 16 Jan 2024 10:48:12 +0100 Subject: [PATCH 1/3] fix(config): Fix constructor of config class Signed-off-by: Joas Schilling --- lib/AppConfigOverwrite.php | 8 +++++--- lib/RestrictionManager.php | 13 +++++++++---- tests/stub.php | 9 ++++++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/AppConfigOverwrite.php b/lib/AppConfigOverwrite.php index 66ce8fd7..dbf419be 100644 --- a/lib/AppConfigOverwrite.php +++ b/lib/AppConfigOverwrite.php @@ -24,7 +24,8 @@ namespace OCA\Guests; use OC\AppConfig; -use OC\DB\ConnectionAdapter; +use OCP\IDBConnection; +use Psr\Log\LoggerInterface; class AppConfigOverwrite extends AppConfig { @@ -32,10 +33,11 @@ class AppConfigOverwrite extends AppConfig { private $overWrite; public function __construct( - ConnectionAdapter $conn, + IDBConnection $connection, + LoggerInterface $logger, array $overWrite ) { - parent::__construct($conn->getInner()); + parent::__construct($connection, $logger); $this->overWrite = $overWrite; } diff --git a/lib/RestrictionManager.php b/lib/RestrictionManager.php index 8d6fd729..cb7c4e95 100644 --- a/lib/RestrictionManager.php +++ b/lib/RestrictionManager.php @@ -33,6 +33,7 @@ use OCP\IUser; use OCP\IUserSession; use OCP\Settings\IManager; +use Psr\Log\LoggerInterface; class RestrictionManager { /** @var AppWhitelist */ @@ -119,11 +120,15 @@ public function lateSetupRestrictions(): void { $this->userBackend->setAllowListing(false); $this->server->registerService(AppConfig::class, function () { - return new AppConfigOverwrite($this->server->get(IDBConnection::class), [ - 'core' => [ - 'shareapi_only_share_with_group_members' => 'yes' + return new AppConfigOverwrite( + $this->server->get(IDBConnection::class), + $this->server->get(LoggerInterface::class), + [ + 'core' => [ + 'shareapi_only_share_with_group_members' => 'yes' + ] ] - ]); + ); }); } } diff --git a/tests/stub.php b/tests/stub.php index 208c6628..2309cbac 100644 --- a/tests/stub.php +++ b/tests/stub.php @@ -130,8 +130,15 @@ public function setUnreadCounter(string $id, int $unreadCounter): void { } class AppConfig { - public function __construct(\OC\DB\Connection $connection) { + public function __construct( + protected \OCP\IDBConnection $connection, + private \Psr\Log\LoggerInterface $logger, + ) { } + + /** + * @deprecated - use getValue*() + */ public function getValue(string $app, string $key, string $default = null): string { } } From ef04df6c1cb1e55775875481807ba84dbf40c1d5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 16 Jan 2024 12:16:06 +0100 Subject: [PATCH 2/3] fix: Bump requirement to 29 Signed-off-by: Joas Schilling --- appinfo/info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 476a5ffe..329d1f33 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -9,7 +9,7 @@ Guests accounts can be created from the share menu by entering either the recipients email or name and choosing "create guest account", once the share is created the guest user will receive an email notification about the mail with a link to set their password. Guests users can only access files shared to them and cannot create any files outside of shares, additionally, the apps accessible to guest accounts are whitelisted.]]> - 3.0.1 + 3.1.0 agpl Nextcloud @@ -26,7 +26,7 @@ Guests users can only access files shared to them and cannot create any files ou https://raw.githubusercontent.com/nextcloud/guests/master/screenshots/settings.png https://raw.githubusercontent.com/nextcloud/guests/master/screenshots/dropdown.png - + OCA\Guests\Command\ListCommand From 9b0a9183aa569dcbb34724ea90e62ffe52004744 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 18 Jan 2024 17:18:33 +0100 Subject: [PATCH 3/3] PHP_CS_FIXER_IGNORE_ENV Signed-off-by: Robin Appelman --- .github/workflows/lint-php-cs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index 6887055c..6b1df282 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -41,4 +41,4 @@ jobs: run: composer i - name: Lint - run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) + run: PHP_CS_FIXER_IGNORE_ENV=1 composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )