From 870b218caa30e3a717a314a89b25655eb9c9f602 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 18 Oct 2021 18:18:03 +0200 Subject: [PATCH] load apps after install, befor user auto-login - otherwise apps are not registered properly - dependency issues may throw exceptions - Remove profile manager from public API - Some cleanup of unused code - Add @since for new properties Signed-off-by: Arthur Schiwon --- .../lib/Settings/Personal/PersonalInfo.php | 6 +- core/Controller/ProfileApiController.php | 6 +- core/Controller/ProfilePageController.php | 6 +- core/Db/ProfileConfig.php | 8 -- lib/composer/composer/autoload_classmap.php | 1 - lib/composer/composer/autoload_static.php | 1 - lib/private/Accounts/AccountManager.php | 1 + .../AppFramework/Bootstrap/Coordinator.php | 7 -- .../Bootstrap/RegistrationContext.php | 52 +++++------ lib/private/Profile/ProfileManager.php | 86 +++++++------------ lib/private/Server.php | 2 - lib/private/Setup.php | 3 + lib/public/Accounts/IAccountManager.php | 19 ++++ .../Bootstrap/IRegistrationContext.php | 22 ++--- lib/public/Profile/IProfileManager.php | 58 ------------- .../Bootstrap/CoordinatorTest.php | 6 -- 16 files changed, 95 insertions(+), 189 deletions(-) delete mode 100644 lib/public/Profile/IProfileManager.php diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 5470b19a4f630..40ce3b62e1122 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -51,7 +51,7 @@ use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; -use OCP\Profile\IProfileManager; +use OC\Profile\ProfileManager; use OCP\Settings\ISettings; class PersonalInfo implements ISettings { @@ -66,7 +66,7 @@ class PersonalInfo implements ISettings { /** @var IAccountManager */ private $accountManager; - /** @var IProfileManager */ + /** @var ProfileManager */ private $profileManager; /** @var IGroupManager */ @@ -89,7 +89,7 @@ public function __construct( IUserManager $userManager, IGroupManager $groupManager, IAccountManager $accountManager, - IProfileManager $profileManager, + ProfileManager $profileManager, IAppManager $appManager, IFactory $l10nFactory, IL10N $l, diff --git a/core/Controller/ProfileApiController.php b/core/Controller/ProfileApiController.php index c83ac64b68415..d9e20701eaa73 100644 --- a/core/Controller/ProfileApiController.php +++ b/core/Controller/ProfileApiController.php @@ -35,14 +35,14 @@ use OCP\IRequest; use OCP\IUserManager; use OCP\IUserSession; -use OCP\Profile\IProfileManager; +use OC\Profile\ProfileManager; class ProfileApiController extends OCSController { /** @var ProfileConfigMapper */ private $configMapper; - /** @var IProfileManager */ + /** @var ProfileManager */ private $profileManager; /** @var IUserManager */ @@ -54,7 +54,7 @@ class ProfileApiController extends OCSController { public function __construct( IRequest $request, ProfileConfigMapper $configMapper, - IProfileManager $profileManager, + ProfileManager $profileManager, IUserManager $userManager, IUserSession $userSession ) { diff --git a/core/Controller/ProfilePageController.php b/core/Controller/ProfilePageController.php index 491e286b98205..a7ceb404fbc24 100644 --- a/core/Controller/ProfilePageController.php +++ b/core/Controller/ProfilePageController.php @@ -33,7 +33,7 @@ use OCP\IRequest; use OCP\IUserManager; use OCP\IUserSession; -use OCP\Profile\IProfileManager; +use OC\Profile\ProfileManager; use OCP\UserStatus\IManager as IUserStatusManager; class ProfilePageController extends Controller { @@ -45,7 +45,7 @@ class ProfilePageController extends Controller { /** @var IAccountManager */ private $accountManager; - /** @var IProfileManager */ + /** @var ProfileManager */ private $profileManager; /** @var IUserManager */ @@ -62,7 +62,7 @@ public function __construct( IRequest $request, IInitialState $initialStateService, IAccountManager $accountManager, - IProfileManager $profileManager, + ProfileManager $profileManager, IUserManager $userManager, IUserSession $userSession, IUserStatusManager $userStatusManager diff --git a/core/Db/ProfileConfig.php b/core/Db/ProfileConfig.php index de54065eb9b50..eb50da37a641c 100644 --- a/core/Db/ProfileConfig.php +++ b/core/Db/ProfileConfig.php @@ -75,14 +75,6 @@ class ProfileConfig extends Entity implements JsonSerializable { IAccountManager::PROPERTY_HEADLINE => self::VISIBILITY_SHOW, IAccountManager::PROPERTY_ORGANISATION => self::VISIBILITY_SHOW, IAccountManager::PROPERTY_ROLE => self::VISIBILITY_SHOW, - ]; - - /** - * Default account property action visibility - * - * @since 23.0.0 - */ - public const DEFAULT_PROPERTY_ACTION_VISIBILITY = [ IAccountManager::PROPERTY_EMAIL => self::VISIBILITY_SHOW_USERS_ONLY, IAccountManager::PROPERTY_PHONE => self::VISIBILITY_SHOW_USERS_ONLY, IAccountManager::PROPERTY_TWITTER => self::VISIBILITY_SHOW, diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 1e0aa8d410d5f..fa1ef50c41e8d 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -461,7 +461,6 @@ 'OCP\\Preview\\IProviderV2' => $baseDir . '/lib/public/Preview/IProviderV2.php', 'OCP\\Preview\\IVersionedPreviewFile' => $baseDir . '/lib/public/Preview/IVersionedPreviewFile.php', 'OCP\\Profile\\ILinkAction' => $baseDir . '/lib/public/Profile/ILinkAction.php', - 'OCP\\Profile\\IProfileManager' => $baseDir . '/lib/public/Profile/IProfileManager.php', 'OCP\\Profile\\ParameterDoesNotExistException' => $baseDir . '/lib/public/Profile/ParameterDoesNotExistException.php', 'OCP\\Remote\\Api\\IApiCollection' => $baseDir . '/lib/public/Remote/Api/IApiCollection.php', 'OCP\\Remote\\Api\\IApiFactory' => $baseDir . '/lib/public/Remote/Api/IApiFactory.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 5e3e115817d91..89892d45ab022 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -490,7 +490,6 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OCP\\Preview\\IProviderV2' => __DIR__ . '/../../..' . '/lib/public/Preview/IProviderV2.php', 'OCP\\Preview\\IVersionedPreviewFile' => __DIR__ . '/../../..' . '/lib/public/Preview/IVersionedPreviewFile.php', 'OCP\\Profile\\ILinkAction' => __DIR__ . '/../../..' . '/lib/public/Profile/ILinkAction.php', - 'OCP\\Profile\\IProfileManager' => __DIR__ . '/../../..' . '/lib/public/Profile/IProfileManager.php', 'OCP\\Profile\\ParameterDoesNotExistException' => __DIR__ . '/../../..' . '/lib/public/Profile/ParameterDoesNotExistException.php', 'OCP\\Remote\\Api\\IApiCollection' => __DIR__ . '/../../..' . '/lib/public/Remote/Api/IApiCollection.php', 'OCP\\Remote\\Api\\IApiFactory' => __DIR__ . '/../../..' . '/lib/public/Remote/Api/IApiFactory.php', diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 3416db56ba562..8b3c10bc6c835 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -712,6 +712,7 @@ protected function buildDefaultUserRecord(IUser $user) { [ 'name' => self::PROPERTY_PROFILE_ENABLED, 'value' => '1', + 'scope' => self::SCOPE_LOCAL, ], ]; } diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php index 71652fa1d7d90..6e05b7fdc8802 100644 --- a/lib/private/AppFramework/Bootstrap/Coordinator.php +++ b/lib/private/AppFramework/Bootstrap/Coordinator.php @@ -41,7 +41,6 @@ use OCP\Dashboard\IManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\IServerContainer; -use OCP\Profile\IProfileManager; use Psr\Log\LoggerInterface; use Throwable; @@ -56,9 +55,6 @@ class Coordinator { /** @var IManager */ private $dashboardManager; - /** @var IProfileManager */ - private $profileManager; - /** @var IEventDispatcher */ private $eventDispatcher; @@ -75,14 +71,12 @@ public function __construct( IServerContainer $container, Registry $registry, IManager $dashboardManager, - IProfileManager $profileManager, IEventDispatcher $eventListener, LoggerInterface $logger ) { $this->serverContainer = $container; $this->registry = $registry; $this->dashboardManager = $dashboardManager; - $this->profileManager = $profileManager; $this->eventDispatcher = $eventListener; $this->logger = $logger; } @@ -150,7 +144,6 @@ private function registerApps(array $appIds): void { $this->registrationContext->delegateCapabilityRegistrations($apps); $this->registrationContext->delegateCrashReporterRegistrations($apps, $this->registry); $this->registrationContext->delegateDashboardPanelRegistrations($apps, $this->dashboardManager); - $this->registrationContext->delegateProfileActionRegistrations($apps, $this->profileManager); $this->registrationContext->delegateEventListenerRegistrations($this->eventDispatcher); $this->registrationContext->delegateContainerRegistrations($apps); $this->registrationContext->delegateMiddlewareRegistrations($apps); diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 35007e9bcef6c..c638af94c8443 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -46,7 +46,6 @@ use OCP\Http\WellKnown\IHandler; use OCP\Notification\INotifier; use OCP\Profile\ILinkAction; -use OCP\Profile\IProfileManager; use OCP\Search\IProvider; use OCP\Support\CrashReport\IReporter; use Psr\Log\LoggerInterface; @@ -146,13 +145,6 @@ public function registerDashboardWidget(string $widgetClass): void { ); } - public function registerProfileAction(string $actionClass): void { - $this->context->registerProfileAction( - $this->appId, - $actionClass - ); - } - public function registerService(string $name, callable $factory, bool $shared = true): void { $this->context->registerService( $this->appId, @@ -249,6 +241,13 @@ public function registerCalendarProvider(string $class): void { $class ); } + + public function registerProfileAction(string $actionClass): void { + $this->context->registerProfileAction( + $this->appId, + $actionClass + ); + } }; } @@ -273,13 +272,6 @@ public function registerDashboardPanel(string $appId, string $panelClass): void $this->dashboardPanels[] = new ServiceRegistration($appId, $panelClass); } - /** - * @psalm-param class-string $capability - */ - public function registerProfileAction(string $appId, string $actionClass): void { - $this->profileActions[] = new ServiceRegistration($appId, $actionClass); - } - public function registerService(string $appId, string $name, callable $factory, bool $shared = true): void { $this->services[] = new ServiceFactoryRegistration($appId, $name, $factory, $shared); } @@ -335,6 +327,13 @@ public function registerCalendarProvider(string $appId, string $class): void { $this->calendarProviders[] = new ServiceRegistration($appId, $class); } + /** + * @psalm-param class-string $capability + */ + public function registerProfileAction(string $appId, string $actionClass): void { + $this->profileActions[] = new ServiceRegistration($appId, $actionClass); + } + /** * @param App[] $apps */ @@ -393,22 +392,6 @@ public function delegateDashboardPanelRegistrations(array $apps, IManager $dashb } } - /** - * @param App[] $apps - */ - public function delegateProfileActionRegistrations(array $apps, IProfileManager $profileManager): void { - while (($action = array_shift($this->profileActions)) !== null) { - try { - $profileManager->queueAction($action->getService()); - } catch (Throwable $e) { - $appId = $action->getAppId(); - $this->logger->error("Error during queuing of profile action for $appId: " . $e->getMessage(), [ - 'exception' => $e, - ]); - } - } - } - public function delegateEventListenerRegistrations(IEventDispatcher $eventDispatcher): void { while (($registration = array_shift($this->eventListeners)) !== null) { try { @@ -588,4 +571,11 @@ public function getTwoFactorProviders(): array { public function getCalendarProviders(): array { return $this->calendarProviders; } + + /** + * @return ServiceRegistration[] + */ + public function getProfileActions(): array { + return $this->profileActions; + } } diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php index 0b16ff2139003..6a38f4ae16d85 100644 --- a/lib/private/Profile/ProfileManager.php +++ b/lib/private/Profile/ProfileManager.php @@ -28,6 +28,7 @@ use function Safe\usort; +use OC\AppFramework\Bootstrap\Coordinator; use OC\Core\Db\ProfileConfig; use OC\Core\Db\ProfileConfigMapper; use OC\KnownUser\KnownUserService; @@ -42,16 +43,13 @@ use OCP\IUser; use OCP\L10N\IFactory; use OCP\Profile\ILinkAction; -use OCP\Profile\IProfileManager; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use Throwable; -use TypeError; /** * @inheritDoc */ -class ProfileManager implements IProfileManager { +class ProfileManager { /** @var IAccountManager */ private $accountManager; @@ -74,14 +72,13 @@ class ProfileManager implements IProfileManager { /** @var LoggerInterface */ private $logger; + /** @var Coordinator */ + private $coordinator; + /** @var ILinkAction[] */ private $actions = []; - /** @var string[] */ - private $appActionQueue = []; - - /** @var string[] */ - private $accountPropertyActionQueue = [ + private const ACCOUNT_PROPERTY_ACTIONS = [ EmailAction::class, PhoneAction::class, WebsiteAction::class, @@ -107,7 +104,8 @@ public function __construct( ContainerInterface $container, KnownUserService $knownUserService, IFactory $l10nFactory, - LoggerInterface $logger + LoggerInterface $logger, + Coordinator $coordinator ) { $this->accountManager = $accountManager; $this->appManager = $appManager; @@ -116,13 +114,7 @@ public function __construct( $this->knownUserService = $knownUserService; $this->l10nFactory = $l10nFactory; $this->logger = $logger; - } - - /** - * @inheritDoc - */ - public function queueAction(string $actionClass): void { - $this->appActionQueue[] = $actionClass; + $this->coordinator = $coordinator; } /** @@ -160,48 +152,28 @@ private function registerAction(IUser $targetUser, ?IUser $visitingUser, ILinkAc $this->actions[$action->getId()] = $action; } - /** - * Load actions for the user - */ - private function loadActions(IUser $targetUser, ?IUser $visitingUser): void { - $allActionQueue = array_merge($this->accountPropertyActionQueue, $this->appActionQueue); - - foreach ($allActionQueue as $actionClass) { - try { - /** @var ILinkAction $action */ - $action = $this->container->get($actionClass); - try { - $this->registerAction($targetUser, $visitingUser, $action); - } catch (TypeError $e) { - $this->logger->error( - "$actionClass is not an \OCP\Profile\ILinkAction instance", - [ - 'exception' => $e, - ] - ); - } - } catch (Throwable $e) { - $this->logger->error( - "Could not find profile action class: $actionClass", - [ - 'exception' => $e, - ] - ); - } - } - - // Clear queues after actions have been registered - $this->accountPropertyActionQueue = []; - $this->appActionQueue = []; - } - /** * Return an array of registered profile actions for the user * * @return ILinkAction[] */ private function getActions(IUser $targetUser, ?IUser $visitingUser): array { - $this->loadActions($targetUser, $visitingUser); + $context = $this->coordinator->getRegistrationContext(); + if ($context === null) { + return []; + } + + foreach (self::ACCOUNT_PROPERTY_ACTIONS as $actionClass) { + /** @var ILinkAction $provider */ + $provider = $this->container->get($actionClass); + $this->registerAction($targetUser, $visitingUser, $provider); + } + + foreach ($context->getProfileActions() as $registration) { + /** @var ILinkAction $provider */ + $provider = $this->container->get($registration->getService()); + $this->registerAction($targetUser, $visitingUser, $provider); + } $actionsClone = $this->actions; // Sort associative array into indexed array in ascending order of priority @@ -316,7 +288,7 @@ public function getProfileConfig(IUser $targetUser, ?IUser $visitingUser): array $config = new ProfileConfig(); $config->setUserId($targetUser->getUID()); - // Map of non-action account properties to display IDs + // Map of account properties to display IDs $propertyDisplayMap = [ IAccountManager::PROPERTY_ADDRESS => $this->l10nFactory->get('core')->t('Address'), IAccountManager::PROPERTY_AVATAR => $this->l10nFactory->get('core')->t('Avatar'), @@ -325,6 +297,10 @@ public function getProfileConfig(IUser $targetUser, ?IUser $visitingUser): array IAccountManager::PROPERTY_HEADLINE => $this->l10nFactory->get('core')->t('Headline'), IAccountManager::PROPERTY_ORGANISATION => $this->l10nFactory->get('core')->t('Organisation'), IAccountManager::PROPERTY_ROLE => $this->l10nFactory->get('core')->t('Role'), + IAccountManager::PROPERTY_EMAIL => $this->l10nFactory->get('core')->t('Email'), + IAccountManager::PROPERTY_PHONE => $this->l10nFactory->get('core')->t('Phone'), + IAccountManager::PROPERTY_TWITTER => $this->l10nFactory->get('core')->t('Twitter'), + IAccountManager::PROPERTY_WEBSITE => $this->l10nFactory->get('core')->t('Website'), ]; // Contruct the default config for account properties @@ -342,7 +318,7 @@ public function getProfileConfig(IUser $targetUser, ?IUser $visitingUser): array foreach ($this->getActions($targetUser, $visitingUser) as $action) { $actionsConfig[$action->getId()] = [ 'displayId' => $action->getDisplayId(), - 'visibility' => ProfileConfig::DEFAULT_PROPERTY_ACTION_VISIBILITY[$action->getId()] ?: ProfileConfig::DEFAULT_VISIBILITY, + 'visibility' => ProfileConfig::DEFAULT_VISIBILITY, ]; } diff --git a/lib/private/Server.php b/lib/private/Server.php index dee79345b503d..a9ea07c27d34c 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1379,8 +1379,6 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerAlias(\OCP\UserStatus\IManager::class, \OC\UserStatus\Manager::class); - $this->registerAlias(\OCP\Profile\IProfileManager::class, \OC\Profile\ProfileManager::class); - $this->connectDispatcher(); } diff --git a/lib/private/Setup.php b/lib/private/Setup.php index c24d417f8cf20..a7f0f190fa292 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -425,6 +425,9 @@ public function install($options) { //and we are done $config->setSystemValue('installed', true); + $bootstrapCoordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class); + $bootstrapCoordinator->runInitialRegistration(); + // Create a session token for the newly created user // The token provider requires a working db, so it's not injected on setup /* @var $userSession User\Session */ diff --git a/lib/public/Accounts/IAccountManager.php b/lib/public/Accounts/IAccountManager.php index 216027e34ac3b..ae5f6b1e542bd 100644 --- a/lib/public/Accounts/IAccountManager.php +++ b/lib/public/Accounts/IAccountManager.php @@ -97,10 +97,29 @@ interface IAccountManager { public const PROPERTY_ADDRESS = 'address'; public const PROPERTY_TWITTER = 'twitter'; + /** + * @since 23.0.0 + */ public const PROPERTY_ORGANISATION = 'organisation'; + + /** + * @since 23.0.0 + */ public const PROPERTY_ROLE = 'role'; + + /** + * @since 23.0.0 + */ public const PROPERTY_HEADLINE = 'headline'; + + /** + * @since 23.0.0 + */ public const PROPERTY_BIOGRAPHY = 'biography'; + + /** + * @since 23.0.0 + */ public const PROPERTY_PROFILE_ENABLED = 'profile_enabled'; public const COLLECTION_EMAIL = 'additional_mail'; diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php index ae932ac6037bf..f75cdb18cfbf6 100644 --- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php +++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php @@ -76,17 +76,6 @@ public function registerCrashReporter(string $reporterClass): void; */ public function registerDashboardWidget(string $widgetClass): void; - /** - * Register an implementation of \OCP\Profile\ILinkAction that - * will handle the implementation of a profile action - * - * @param string $actionClass - * @psalm-param class-string<\OCP\Profile\ILinkAction> $actionClass - * @return void - * @since 23.0.0 - */ - public function registerProfileAction(string $actionClass): void; - /** * Register a service * @@ -250,4 +239,15 @@ public function registerTwoFactorProvider(string $twoFactorProviderClass): void; * @since 23.0.0 */ public function registerCalendarProvider(string $class): void; + + /** + * Register an implementation of \OCP\Profile\ILinkAction that + * will handle the implementation of a profile action + * + * @param string $actionClass + * @psalm-param class-string<\OCP\Profile\ILinkAction> $actionClass + * @return void + * @since 23.0.0 + */ + public function registerProfileAction(string $actionClass): void; } diff --git a/lib/public/Profile/IProfileManager.php b/lib/public/Profile/IProfileManager.php deleted file mode 100644 index 7285099fdac10..0000000000000 --- a/lib/public/Profile/IProfileManager.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * @author Christopher Ng - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -namespace OCP\Profile; - -use OCP\IUser; - -/** - * @since 23.0.0 - */ -interface IProfileManager { - - /** - * Add an action to the registration queue - * - * @since 23.0.0 - */ - public function queueAction(string $actionClass): void; - - /** - * Returns the profile parameters visible to the visiting user in an - * associative array - * - * @since 23.0.0 - */ - public function getProfileParams(IUser $targetUser, ?IUser $visitingUser): array; - - /** - * Returns the profile config in an associative array. If a profile config - * does not exist for the targetUser a default profile config is created - * - * @since 23.0.0 - */ - public function getProfileConfig(IUser $targetUser, ?IUser $visitingUser): array; -} diff --git a/tests/lib/AppFramework/Bootstrap/CoordinatorTest.php b/tests/lib/AppFramework/Bootstrap/CoordinatorTest.php index 16714aba7462b..d6ceefa42684d 100644 --- a/tests/lib/AppFramework/Bootstrap/CoordinatorTest.php +++ b/tests/lib/AppFramework/Bootstrap/CoordinatorTest.php @@ -36,7 +36,6 @@ use OCP\Dashboard\IManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\IServerContainer; -use OCP\Profile\IProfileManager; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; @@ -55,9 +54,6 @@ class CoordinatorTest extends TestCase { /** @var IManager|MockObject */ private $dashboardManager; - /** @var IProfileManager|MockObject */ - private $profileManager; - /** @var IEventDispatcher|MockObject */ private $eventDispatcher; @@ -74,7 +70,6 @@ protected function setUp(): void { $this->serverContainer = $this->createMock(IServerContainer::class); $this->crashReporterRegistry = $this->createMock(Registry::class); $this->dashboardManager = $this->createMock(IManager::class); - $this->profileManager = $this->createMock(IProfileManager::class); $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $this->logger = $this->createMock(LoggerInterface::class); @@ -82,7 +77,6 @@ protected function setUp(): void { $this->serverContainer, $this->crashReporterRegistry, $this->dashboardManager, - $this->profileManager, $this->eventDispatcher, $this->logger );