Create DI::eventDispatcher() where constructor injection is not possible atm

This commit is contained in:
Art4 2025-01-27 15:39:22 +00:00 committed by Hypolite Petovan
parent 2a02f58886
commit 7e199f034b

View 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);
}
}