Skip to content

Commit a080187

Browse files
committed
chore: Unify user related events to always provide a getUid method
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 871db4e commit a080187

6 files changed

Lines changed: 36 additions & 1 deletion

File tree

core/Events/BeforePasswordResetEvent.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public function getUser(): IUser {
3434
return $this->user;
3535
}
3636

37+
/**
38+
* @since 31.0.0
39+
*/
40+
public function getUid(): string {
41+
return $this->user->getUID();
42+
}
43+
3744
/**
3845
* @since 25.0.0
3946
*/

core/Events/PasswordResetEvent.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public function getUser(): IUser {
3434
return $this->user;
3535
}
3636

37+
/**
38+
* @since 31.0.0
39+
*/
40+
public function getUid(): string {
41+
return $this->user->getUID();
42+
}
43+
3744
/**
3845
* @since 25.0.0
3946
*/

lib/public/AppFramework/Bootstrap/IRegistrationContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function registerDashboardWidget(string $widgetClass): void;
6969
* @param string $name
7070
* @param callable $factory
7171
* @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory
72-
* @param bool $shared
72+
* @param bool $shared If set to true the factory result will be cached otherwise every query will call the factory again
7373
*
7474
* @return void
7575
* @see IContainer::registerService()

lib/public/User/Events/PasswordUpdatedEvent.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ public function getUser(): IUser {
4949
return $this->user;
5050
}
5151

52+
/**
53+
* @since 31.0.0
54+
*/
55+
public function getUid(): string {
56+
return $this->user->getUID();
57+
}
58+
5259
/**
5360
* @return string
5461
* @since 18.0.0

lib/public/User/Events/UserDeletedEvent.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@ public function __construct(IUser $user) {
3434
public function getUser(): IUser {
3535
return $this->user;
3636
}
37+
38+
/**
39+
* @since 31.0.0
40+
*/
41+
public function getUid(): string {
42+
return $this->user->getUID();
43+
}
3744
}

lib/public/User/Events/UserLoggedInEvent.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public function getUser(): IUser {
4545
return $this->user;
4646
}
4747

48+
/**
49+
* @since 31.0.0
50+
*/
51+
public function getUid(): string {
52+
return $this->user->getUID();
53+
}
54+
4855
/**
4956
* @since 21.0.0
5057
*/

0 commit comments

Comments
 (0)