Skip to content

Commit

Permalink
fix(config): Fix constructor of config class
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jan 16, 2024
1 parent 0e51d90 commit 174beb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/AppConfigOverwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

use OC\AppConfig;
use OC\DB\ConnectionAdapter;
use Psr\Log\LoggerInterface;

class AppConfigOverwrite extends AppConfig {

Expand All @@ -33,9 +34,10 @@ class AppConfigOverwrite extends AppConfig {

public function __construct(
ConnectionAdapter $conn,
LoggerInterface $logger,
array $overWrite
) {
parent::__construct($conn->getInner());
parent::__construct($conn->getInner(), $logger);

Check failure on line 40 in lib/AppConfigOverwrite.php

View workflow job for this annotation

GitHub Actions / Nextcloud dev-stable28

TooManyArguments

lib/AppConfigOverwrite.php:40:3: TooManyArguments: Too many arguments for OC\AppConfig::__construct - expecting 1 but saw 2 (see https://psalm.dev/026)
$this->overWrite = $overWrite;
}

Expand Down
13 changes: 9 additions & 4 deletions lib/RestrictionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use OCP\IUser;
use OCP\IUserSession;
use OCP\Settings\IManager;
use Psr\Log\LoggerInterface;

class RestrictionManager {
/** @var AppWhitelist */
Expand Down Expand Up @@ -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'
]
]
]);
);
});
}
}
Expand Down

0 comments on commit 174beb2

Please sign in to comment.