Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more explicit naming for profile link action #29435

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/private/AppFramework/Bootstrap/RegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class RegistrationContext {
private $dashboardPanels = [];

/** @var ServiceRegistration<ILinkAction>[] */
private $profileActions = [];
private $profileLinkActions = [];

/** @var ServiceFactoryRegistration[] */
private $services = [];
Expand Down Expand Up @@ -253,8 +253,8 @@ public function registerCalendarProvider(string $class): void {
);
}

public function registerProfileAction(string $actionClass): void {
$this->context->registerProfileAction(
public function registerProfileLinkAction(string $actionClass): void {
$this->context->registerProfileLinkAction(
$this->appId,
$actionClass
);
Expand Down Expand Up @@ -343,10 +343,10 @@ public function registerCalendarProvider(string $appId, string $class): void {
}

/**
* @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);
}

/**
Expand Down Expand Up @@ -597,7 +597,7 @@ public function getCalendarProviders(): array {
/**
* @return ServiceRegistration<ILinkAction>[]
*/
public function getProfileActions(): array {
return $this->profileActions;
public function getProfileLinkActions(): array {
return $this->profileLinkActions;
}
}
2 changes: 1 addition & 1 deletion lib/private/Profile/ProfileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private function getActions(IUser $targetUser, ?IUser $visitingUser): array {
$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);
Expand Down
4 changes: 2 additions & 2 deletions lib/public/AppFramework/Bootstrap/IRegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ public function registerCalendarProvider(string $class): void;

/**
* 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;
}