Compare commits
4 Commits
1397afb513
...
cd1f7ea350
| Author | SHA1 | Date | |
|---|---|---|---|
| cd1f7ea350 | |||
| 5b76469ba1 | |||
| 26c233295f | |||
| 72adff3639 |
+2
-1
@@ -4,7 +4,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Potter\\": "src/Potter/"
|
"Potter\\Event\\": "src/Potter/Event/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
@@ -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,20 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Event;
|
||||||
|
|
||||||
|
final class Dispatcher
|
||||||
|
extends \League\Event\EventDispatcher
|
||||||
|
{ }
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Potter;
|
namespace Potter\Event;
|
||||||
|
|
||||||
final class Event
|
final class Event
|
||||||
extends \Symfony\Component\EventDispatcher\GenericEvent
|
extends \Symfony\Component\EventDispatcher\GenericEvent
|
||||||
Reference in New Issue
Block a user