implement EventInterface

This commit is contained in:
2026-07-10 16:40:48 -04:00
parent 5e3a7a1409
commit 998bfa91fe
2 changed files with 24 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Potter\Event;
final class Event extends AbstractEvent
{
use EventTrait;
}
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace Potter\Event;
trait EventTrait
{
final public function eventName(): string
{
return is_string($subject = $this->getSubject()) ?
$subject : get_class($this);
}
abstract public function getSubject(): mixed;
}