modify plugin name
This commit is contained in:
+13
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Kiri\Events;
|
namespace Kiri\Events;
|
||||||
|
|
||||||
use Kiri\Abstracts\Component;
|
|
||||||
use Kiri;
|
use Kiri;
|
||||||
|
use Kiri\Abstracts\Component;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||||
@@ -17,6 +17,17 @@ class EventDispatch extends Component implements EventDispatcherInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param EventProvider $eventProvider
|
||||||
|
* @param array $config
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function __construct(public EventProvider $eventProvider, array $config = [])
|
||||||
|
{
|
||||||
|
parent::__construct($config);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $event
|
* @param object $event
|
||||||
* @return object
|
* @return object
|
||||||
@@ -25,7 +36,7 @@ class EventDispatch extends Component implements EventDispatcherInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(object $event): object
|
public function dispatch(object $event): object
|
||||||
{
|
{
|
||||||
$lists = $this->getEventProvider()->getListenersForEvent($event);
|
$lists = $this->eventProvider->getListenersForEvent($event);
|
||||||
foreach ($lists as $listener) {
|
foreach ($lists as $listener) {
|
||||||
/** @var Struct $list */
|
/** @var Struct $list */
|
||||||
$listener($event);
|
$listener($event);
|
||||||
|
|||||||
Reference in New Issue
Block a user