Compare commits

..

11 Commits

Author SHA1 Message Date
jay dc414f6277 remove has 2026-08-12 16:12:57 -04:00
jay 5e64879e75 add hasDispatcher method 2026-08-12 14:14:12 -04:00
jay ad754c6806 add getDispatcher method 2026-08-12 13:57:50 -04:00
jay cd1f7ea350 add Behaviour trait 2026-08-12 13:56:42 -04:00
jay 5b76469ba1 require potter/container 2026-08-12 13:56:26 -04:00
jay 26c233295f extend \League\Event\EventDispatcher 2026-08-12 13:56:12 -04:00
jay 72adff3639 re-namespace 2026-08-12 13:51:04 -04:00
jay 1397afb513 re-namespace 2026-08-10 14:09:06 -04:00
jay d102e37841 delete Dispatcher 2026-08-10 14:08:31 -04:00
jay a7eb1bad6b extend \League\Event\EventDispatcher 2026-08-10 13:56:01 -04:00
jay e30003a334 change keyword use 2026-08-10 13:54:56 -04:00
4 changed files with 38 additions and 4 deletions
+1
View File
@@ -16,6 +16,7 @@
"minimum-stability": "stable",
"require": {
"league/event": ">=3.0.3",
"potter/container": ">=0.0.1",
"psr/event-dispatcher": ">=1.0.0",
"symfony/event-dispatcher": ">=8.1.2",
"symfony/event-dispatcher-contracts": ">=3.7.1",
+25
View File
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace Potter\Event;
use \Potter\Container;
trait Behaviour
{
private static function addDispatcher(Container $container): void
{
$container->addShared(Dispatcher::class);
}
private static function addEventBehaviour(Container $container): void
{
self::addDispatcher($container);
}
private static function getDispatcher(Container $container): Dispatcher
{
return $container->get(Dispatcher::class);
}
}
+9
View File
@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace Potter\Event;
final class Dispatcher
extends \League\Event\EventDispatcher
{ }
+3 -4
View File
@@ -4,10 +4,9 @@ declare(strict_types=1);
namespace Potter\Event;
use \League\Event\HasEventName;
use \Symfony\Component\EventDispatcher\GenericEvent;
final class Event extends GenericEvent implements HasEventName
final class Event
extends \Symfony\Component\EventDispatcher\GenericEvent
implements \League\Event\HasEventName
{
public function __construct(mixed $subject = null, array $arguments = []) {
parent::__construct($subject, $arguments);