Use more explicit naming for profile link action

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2021-10-25 22:20:19 +00:00
parent 9177afe8ab
commit 9f8eae3f50
3 changed files with 11 additions and 11 deletions

View file

@ -63,7 +63,7 @@ class RegistrationContext {
private $dashboardPanels = [];
/** @var ServiceRegistration<ILinkAction>[] */
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<ILinkAction> $capability
* @psalm-param class-string<ILinkAction> $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<ILinkAction>[]
*/
public function getProfileActions(): array {
return $this->profileActions;
public function getProfileLinkActions(): array {
return $this->profileLinkActions;
}
}

View file

@ -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);

View file

@ -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;
}