feat: Introduce event listener registration contract

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-08-05 22:04:26 -04:00
parent fb39aa57fd
commit 01ed0f3080
4 changed files with 26 additions and 3 deletions
@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace KTXF\Event;
interface EventListenerRegistrarInterface
{
/**
* @param class-string $service
*/
public function listen(
string $module,
string $event,
string $service,
string $method,
DeliveryMode $delivery = DeliveryMode::Immediate,
int $priority = 0,
FailurePolicy $failurePolicy = FailurePolicy::Continue,
): void;
}
+1 -1
View File
@@ -6,7 +6,7 @@ namespace KTXF\Event;
use Psr\Container\ContainerInterface;
final class EventListenerRegistry
final class EventListenerRegistry implements EventListenerRegistrarInterface
{
/** @var array<string, list<EventListenerDefinition>> */
private array $listeners = [];