]> git.mxchange.org Git - friendica.git/commitdiff
Create DI::eventDispatcher() where constructor injection is not possible atm
authorArt4 <art4@wlabs.de>
Mon, 27 Jan 2025 15:39:22 +0000 (15:39 +0000)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 4 Feb 2025 18:22:53 +0000 (13:22 -0500)
src/DI.php

index 94bb4c308acb57d4fd8225f6ec49c6021b4ee823..43a60dae0b7710e935b11286fe9b91345065a38d 100644 (file)
@@ -789,4 +789,13 @@ abstract class DI
        {
                return self::$dice->create(Content\Post\Repository\PostMedia::class);
        }
+
+       /**
+        * @internal The EventDispatcher should never called outside of the core, like in addons or themes
+        * @deprecated 2025.02 Use constructor injection instead
+        */
+       public static function eventDispatcher(): \Psr\EventDispatcher\EventDispatcherInterface
+       {
+               return self::$dice->create(\Psr\EventDispatcher\EventDispatcherInterface::class);
+       }
 }