]> source.dussan.org Git - nextcloud-server.git/commitdiff
chore: Unify user related events to always provide a `getUid` method chore/migrate-encryption-away-from-hooks 48332/head
authorFerdinand Thiessen <opensource@fthiessen.de>
Tue, 15 Oct 2024 15:06:05 +0000 (17:06 +0200)
committerFerdinand Thiessen <opensource@fthiessen.de>
Tue, 15 Oct 2024 16:33:11 +0000 (18:33 +0200)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
core/Events/BeforePasswordResetEvent.php
core/Events/PasswordResetEvent.php
lib/public/AppFramework/Bootstrap/IRegistrationContext.php
lib/public/User/Events/PasswordUpdatedEvent.php
lib/public/User/Events/UserDeletedEvent.php
lib/public/User/Events/UserLoggedInEvent.php

index bd437479150c3a46287b9ee7b7280fa1f7bfa481..428ebfeefadc4533eb29fd405228d693d3a0c8bf 100644 (file)
@@ -34,6 +34,13 @@ class BeforePasswordResetEvent extends Event {
                return $this->user;
        }
 
+       /**
+        * @since 31.0.0
+        */
+       public function getUid(): string {
+               return $this->user->getUID();
+       }
+
        /**
         * @since 25.0.0
         */
index a159c71026332c9783a0fe5175a01c4c839982e2..868899513212fcbf2f90bf9f5d23878308f547ee 100644 (file)
@@ -34,6 +34,13 @@ class PasswordResetEvent extends Event {
                return $this->user;
        }
 
+       /**
+        * @since 31.0.0
+        */
+       public function getUid(): string {
+               return $this->user->getUID();
+       }
+
        /**
         * @since 25.0.0
         */
index 57e76f268d986544b4ef051744e2801623d429a0..b9e5413e5c26081b1af6a8b57060543aba6c4415 100644 (file)
@@ -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()
index 948b69e54b742081c46fc874ff89bfb70f28a46e..d3fd8f078fed24380a4e78a607c2733461b34b84 100644 (file)
@@ -49,6 +49,13 @@ class PasswordUpdatedEvent extends Event {
                return $this->user;
        }
 
+       /**
+        * @since 31.0.0
+        */
+       public function getUid(): string {
+               return $this->user->getUID();
+       }
+
        /**
         * @return string
         * @since 18.0.0
index c5b8e11c888fa2e718d3b93ff2fe02809645e63e..9b74ff960630ce0f9eb9c5ff58655d76382e4c0c 100644 (file)
@@ -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();
+       }
 }
index 61a7b1f79cdba50b18b5c37f3def65c065d483ac..53f61073a5966ebfd90b56772bef50828c3f84e5 100644 (file)
@@ -45,6 +45,13 @@ class UserLoggedInEvent extends Event {
                return $this->user;
        }
 
+       /**
+        * @since 31.0.0
+        */
+       public function getUid(): string {
+               return $this->user->getUID();
+       }
+
        /**
         * @since 21.0.0
         */