diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 3 | ||||
-rw-r--r-- | lib/private/InitialStateService.php | 22 | ||||
-rw-r--r-- | lib/private/UserStatus/Manager.php | 38 |
3 files changed, 22 insertions, 41 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 0bce8ac193b..76261fe6b92 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -38,6 +38,7 @@ use OC\Log\PsrLoggerAdapter; use OC\ServerContainer; use OC\Settings\AuthorizedGroupMapper; use OCA\WorkflowEngine\Manager; +use OCP\App\IAppManager; use OCP\AppFramework\Http\IOutput; use OCP\AppFramework\IAppContainer; use OCP\AppFramework\QueryException; @@ -200,7 +201,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { $server->getUserSession()->isLoggedIn(), $c->get(IGroupManager::class), $c->get(ISubAdmin::class), - $server->getAppManager(), + $c->get(IAppManager::class), $server->getL10N('lib'), $c->get(AuthorizedGroupMapper::class), $c->get(IUserSession::class), diff --git a/lib/private/InitialStateService.php b/lib/private/InitialStateService.php index c930ffd9466..300aa238397 100644 --- a/lib/private/InitialStateService.php +++ b/lib/private/InitialStateService.php @@ -13,29 +13,23 @@ use OC\AppFramework\Bootstrap\Coordinator; use OCP\AppFramework\QueryException; use OCP\AppFramework\Services\InitialStateProvider; use OCP\IInitialStateService; -use OCP\IServerContainer; +use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; class InitialStateService implements IInitialStateService { - /** @var LoggerInterface */ - private $logger; /** @var string[][] */ - private $states = []; + private array $states = []; /** @var Closure[][] */ - private $lazyStates = []; + private array $lazyStates = []; - /** @var Coordinator */ - private $bootstrapCoordinator; - /** @var IServerContainer */ - private $container; - - public function __construct(LoggerInterface $logger, Coordinator $bootstrapCoordinator, IServerContainer $container) { - $this->logger = $logger; - $this->bootstrapCoordinator = $bootstrapCoordinator; - $this->container = $container; + public function __construct( + private LoggerInterface $logger, + private Coordinator $bootstrapCoordinator, + private ContainerInterface $container, + ) { } public function provideInitialState(string $appName, string $key, $data): void { diff --git a/lib/private/UserStatus/Manager.php b/lib/private/UserStatus/Manager.php index 4658f61df82..4cfd1c18e79 100644 --- a/lib/private/UserStatus/Manager.php +++ b/lib/private/UserStatus/Manager.php @@ -8,35 +8,21 @@ declare(strict_types=1); */ namespace OC\UserStatus; -use OCP\IServerContainer; use OCP\UserStatus\IManager; use OCP\UserStatus\IProvider; use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; class Manager implements IManager { - /** @var IServerContainer */ - private $container; - - /** @var LoggerInterface */ - private $logger; - - /** @var class-string */ - private $providerClass; - - /** @var IProvider */ - private $provider; - - /** - * Manager constructor. - * - * @param IServerContainer $container - * @param LoggerInterface $logger - */ - public function __construct(IServerContainer $container, - LoggerInterface $logger) { - $this->container = $container; - $this->logger = $logger; + /** @var ?class-string */ + private ?string $providerClass = null; + private ?IProvider $provider = null; + + public function __construct( + private ContainerInterface $container, + private LoggerInterface $logger, + ) { } /** @@ -89,7 +75,7 @@ class Manager implements IManager { public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup = false, ?string $customMessage = null): void { $this->setupProvider(); - if (!$this->provider || !($this->provider instanceof ISettableProvider)) { + if (!$this->provider instanceof ISettableProvider) { return; } @@ -98,7 +84,7 @@ class Manager implements IManager { public function revertUserStatus(string $userId, string $messageId, string $status): void { $this->setupProvider(); - if (!$this->provider || !($this->provider instanceof ISettableProvider)) { + if (!$this->provider instanceof ISettableProvider) { return; } $this->provider->revertUserStatus($userId, $messageId, $status); @@ -106,7 +92,7 @@ class Manager implements IManager { public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void { $this->setupProvider(); - if (!$this->provider || !($this->provider instanceof ISettableProvider)) { + if (!$this->provider instanceof ISettableProvider) { return; } $this->provider->revertMultipleUserStatus($userIds, $messageId, $status); |