Compare commits
9 Commits
a7eb1bad6b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| dc414f6277 | |||
| 5e64879e75 | |||
| ad754c6806 | |||
| cd1f7ea350 | |||
| 5b76469ba1 | |||
| 26c233295f | |||
| 72adff3639 | |||
| 1397afb513 | |||
| d102e37841 |
@@ -16,6 +16,7 @@
|
|||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"require": {
|
"require": {
|
||||||
"league/event": ">=3.0.3",
|
"league/event": ">=3.0.3",
|
||||||
|
"potter/container": ">=0.0.1",
|
||||||
"psr/event-dispatcher": ">=1.0.0",
|
"psr/event-dispatcher": ">=1.0.0",
|
||||||
"symfony/event-dispatcher": ">=8.1.2",
|
"symfony/event-dispatcher": ">=8.1.2",
|
||||||
"symfony/event-dispatcher-contracts": ">=3.7.1",
|
"symfony/event-dispatcher-contracts": ">=3.7.1",
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,5 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Potter\Event;
|
namespace Potter\Event;
|
||||||
|
|
||||||
final class Dispatcher extends \League\Event\EventDispatcher
|
final class Dispatcher
|
||||||
|
extends \League\Event\EventDispatcher
|
||||||
{ }
|
{ }
|
||||||
|
|||||||
Reference in New Issue
Block a user