chore: complete update
This commit is contained in:
24
src/Framework/EventBus/EventHandler.php
Normal file
24
src/Framework/EventBus/EventHandler.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\EventBus;
|
||||
|
||||
/**
|
||||
* Attribut, das eine Methode als Event-Handler kennzeichnet.
|
||||
*
|
||||
* Beispiel:
|
||||
* #[EventHandler]
|
||||
* public function handleUserRegistered(UserRegistered $event): void { ... }
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)]
|
||||
final readonly class EventHandler
|
||||
{
|
||||
/**
|
||||
* @param int|null $priority Priorität des Handlers (höhere Werte werden zuerst ausgeführt)
|
||||
* @param bool $stopPropagation Gibt an, ob die Event-Propagation nach diesem Handler gestoppt werden soll
|
||||
*/
|
||||
public function __construct(
|
||||
public ?int $priority = null,
|
||||
public bool $stopPropagation = false
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user