aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-10-15 17:06:05 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-10-15 18:33:11 +0200
commitb4ec7ca55983374a2365bad92c41eeb63514088d (patch)
tree37262d493bbd3d0753e805166d1dd730151e3834
parentf3aa004b1c18e0a5fe69112b97cf4ac4fd968cb7 (diff)
downloadnextcloud-server-b4ec7ca55983374a2365bad92c41eeb63514088d.tar.gz
nextcloud-server-b4ec7ca55983374a2365bad92c41eeb63514088d.zip
chore: Unify user related events to always provide a `getUid` methodchore/migrate-encryption-away-from-hooks
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r--core/Events/BeforePasswordResetEvent.php7
-rw-r--r--core/Events/PasswordResetEvent.php7
-rw-r--r--lib/public/AppFramework/Bootstrap/IRegistrationContext.php2
-rw-r--r--lib/public/User/Events/PasswordUpdatedEvent.php7
-rw-r--r--lib/public/User/Events/UserDeletedEvent.php7
-rw-r--r--lib/public/User/Events/UserLoggedInEvent.php7
6 files changed, 36 insertions, 1 deletions
diff --git a/core/Events/BeforePasswordResetEvent.php b/core/Events/BeforePasswordResetEvent.php
index bd437479150..428ebfeefad 100644
--- a/core/Events/BeforePasswordResetEvent.php
+++ b/core/Events/BeforePasswordResetEvent.php
@@ -35,6 +35,13 @@ class BeforePasswordResetEvent extends Event {
}
/**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
+
+ /**
* @since 25.0.0
*/
public function getPassword(): string {
diff --git a/core/Events/PasswordResetEvent.php b/core/Events/PasswordResetEvent.php
index a159c710263..86889951321 100644
--- a/core/Events/PasswordResetEvent.php
+++ b/core/Events/PasswordResetEvent.php
@@ -35,6 +35,13 @@ class PasswordResetEvent extends Event {
}
/**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
+
+ /**
* @since 25.0.0
*/
public function getPassword(): string {
diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
index 57e76f268d9..b9e5413e5c2 100644
--- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
+++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
@@ -69,7 +69,7 @@ interface IRegistrationContext {
* @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()
diff --git a/lib/public/User/Events/PasswordUpdatedEvent.php b/lib/public/User/Events/PasswordUpdatedEvent.php
index 948b69e54b7..d3fd8f078fe 100644
--- a/lib/public/User/Events/PasswordUpdatedEvent.php
+++ b/lib/public/User/Events/PasswordUpdatedEvent.php
@@ -50,6 +50,13 @@ class PasswordUpdatedEvent extends Event {
}
/**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
+
+ /**
* @return string
* @since 18.0.0
*/
diff --git a/lib/public/User/Events/UserDeletedEvent.php b/lib/public/User/Events/UserDeletedEvent.php
index c5b8e11c888..9b74ff96063 100644
--- a/lib/public/User/Events/UserDeletedEvent.php
+++ b/lib/public/User/Events/UserDeletedEvent.php
@@ -34,4 +34,11 @@ class UserDeletedEvent extends Event {
public function getUser(): IUser {
return $this->user;
}
+
+ /**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
}
diff --git a/lib/public/User/Events/UserLoggedInEvent.php b/lib/public/User/Events/UserLoggedInEvent.php
index 61a7b1f79cd..53f61073a59 100644
--- a/lib/public/User/Events/UserLoggedInEvent.php
+++ b/lib/public/User/Events/UserLoggedInEvent.php
@@ -46,6 +46,13 @@ class UserLoggedInEvent extends Event {
}
/**
+ * @since 31.0.0
+ */
+ public function getUid(): string {
+ return $this->user->getUID();
+ }
+
+ /**
* @since 21.0.0
*/
public function getLoginName(): string {