From 9f8eae3f50d61e2bbe849ce2e9a15a6567a65706 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Mon, 25 Oct 2021 22:20:19 +0000 Subject: [PATCH] Use more explicit naming for profile link action Signed-off-by: Christopher Ng --- .../Bootstrap/RegistrationContext.php | 16 ++++++++-------- lib/private/Profile/ProfileManager.php | 2 +- .../Bootstrap/IRegistrationContext.php | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 256d3e2346b..6a9073b576b 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -63,7 +63,7 @@ class RegistrationContext { private $dashboardPanels = []; /** @var ServiceRegistration[] */ - private $profileActions = []; + private $profileLinkActions = []; /** @var ServiceFactoryRegistration[] */ private $services = []; @@ -253,8 +253,8 @@ class RegistrationContext { ); } - public function registerProfileAction(string $actionClass): void { - $this->context->registerProfileAction( + public function registerProfileLinkAction(string $actionClass): void { + $this->context->registerProfileLinkAction( $this->appId, $actionClass ); @@ -343,10 +343,10 @@ class RegistrationContext { } /** - * @psalm-param class-string $capability + * @psalm-param class-string $actionClass */ - public function registerProfileAction(string $appId, string $actionClass): void { - $this->profileActions[] = new ServiceRegistration($appId, $actionClass); + public function registerProfileLinkAction(string $appId, string $actionClass): void { + $this->profileLinkActions[] = new ServiceRegistration($appId, $actionClass); } /** @@ -597,7 +597,7 @@ class RegistrationContext { /** * @return ServiceRegistration[] */ - public function getProfileActions(): array { - return $this->profileActions; + public function getProfileLinkActions(): array { + return $this->profileLinkActions; } } diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php index e0c619725e7..bf974e98e0f 100644 --- a/lib/private/Profile/ProfileManager.php +++ b/lib/private/Profile/ProfileManager.php @@ -168,7 +168,7 @@ class ProfileManager { $this->registerAction($targetUser, $visitingUser, $provider); } - foreach ($context->getProfileActions() as $registration) { + foreach ($context->getProfileLinkActions() as $registration) { /** @var ILinkAction $provider */ $provider = $this->container->get($registration->getService()); $this->registerAction($targetUser, $visitingUser, $provider); diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php index de391050ec1..3e5aef06e8b 100644 --- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php +++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php @@ -255,12 +255,12 @@ interface IRegistrationContext { /** * Register an implementation of \OCP\Profile\ILinkAction that - * will handle the implementation of a profile action + * will handle the implementation of a profile link action * * @param string $actionClass * @psalm-param class-string<\OCP\Profile\ILinkAction> $actionClass * @return void * @since 23.0.0 */ - public function registerProfileAction(string $actionClass): void; + public function registerProfileLinkAction(string $actionClass): void; } -- 2.39.5