Skip to content

Commit

Permalink
chore: Unify user related events to always provide a getUid method
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Oct 15, 2024
1 parent f3aa004 commit b4ec7ca
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
7 changes: 7 additions & 0 deletions core/Events/BeforePasswordResetEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public function getUser(): IUser {
return $this->user;
}

/**
* @since 31.0.0
*/
public function getUid(): string {
return $this->user->getUID();
}

/**
* @since 25.0.0
*/
Expand Down
7 changes: 7 additions & 0 deletions core/Events/PasswordResetEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public function getUser(): IUser {
return $this->user;
}

/**
* @since 31.0.0
*/
public function getUid(): string {
return $this->user->getUID();
}

/**
* @since 25.0.0
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/public/AppFramework/Bootstrap/IRegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function registerDashboardWidget(string $widgetClass): void;
* @param string $name
* @param callable $factory
* @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory
* @param bool $shared
* @param bool $shared If set to true the factory result will be cached otherwise every query will call the factory again
*
* @return void
* @see IContainer::registerService()
Expand Down
7 changes: 7 additions & 0 deletions lib/public/User/Events/PasswordUpdatedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ public function getUser(): IUser {
return $this->user;
}

/**
* @since 31.0.0
*/
public function getUid(): string {
return $this->user->getUID();
}

/**
* @return string
* @since 18.0.0
Expand Down
7 changes: 7 additions & 0 deletions lib/public/User/Events/UserDeletedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ public function __construct(IUser $user) {
public function getUser(): IUser {
return $this->user;
}

/**
* @since 31.0.0
*/
public function getUid(): string {
return $this->user->getUID();
}
}
7 changes: 7 additions & 0 deletions lib/public/User/Events/UserLoggedInEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public function getUser(): IUser {
return $this->user;
}

/**
* @since 31.0.0
*/
public function getUid(): string {
return $this->user->getUID();
}

/**
* @since 21.0.0
*/
Expand Down

0 comments on commit b4ec7ca

Please sign in to comment.