Skip to content

Commit

Permalink
Merge pull request #1 from Micro-PHP/release-1.0
Browse files Browse the repository at this point in the history
Release 1.0
Asisyas authored Nov 23, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents c1b88b2 + 5606c0e commit ac870b0
Showing 7 changed files with 22 additions and 5 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
7 changes: 4 additions & 3 deletions composer.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "micro/plugin-event-emitter",
"description": "MIcro Framework: Application plugin for provide Event Emitter",
"description": "Micro Framework: Application plugin to provide an event emitter",
"type": "library",
"license": "MIT",
"version": "0.1",
"version": "1.0",
"autoload": {
"psr-4": {
"Micro\\Plugin\\EventEmitter\\": "src/"
@@ -16,6 +16,7 @@
}
],
"require": {
"micro/event-emitter": "^0.1"
"micro/event-emitter": "^1",
"micro/kernel": "^1"
}
}
Empty file modified phpcs.xml
100644 → 100755
Empty file.
14 changes: 12 additions & 2 deletions src/Business/Facade/EventsFacade.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -13,13 +13,13 @@ class EventsFacade implements EventsFacadeInterface
/**
* @var EventEmitterInterface
*/
private EventEmitterInterface $eventEmitter;
private readonly EventEmitterInterface $eventEmitter;

/**
* @param EventEmitterFactoryInterface $eventEmitterFactory
*/
public function __construct(
private EventEmitterFactoryInterface $eventEmitterFactory
private readonly EventEmitterFactoryInterface $eventEmitterFactory
)
{
$this->eventEmitter = $this->eventEmitterFactory->create();
@@ -40,4 +40,14 @@ public function emit(EventInterface $event): void
{
$this->eventEmitter->emit($event);
}

/**
* @TODO: Provide events to Global
*
* {@inheritDoc}
*/
public function createEventEmitter(bool $provideEventsToGlobal = false): EventEmitterInterface
{
return $this->eventEmitterFactory->create();
}
}
Empty file modified src/EventEmitterPlugin.php
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions src/EventsFacadeInterface.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

namespace Micro\Plugin\EventEmitter;

use Micro\Component\EventEmitter\EventEmitterInterface;
use Micro\Component\EventEmitter\EventInterface;
use Micro\Component\EventEmitter\ListenerProviderInterface;

@@ -19,4 +20,9 @@ public function addProvider(ListenerProviderInterface $listenerProvider): void;
* @return void
*/
public function emit(EventInterface $event): void;

/**
* @return EventEmitterInterface
*/
public function createEventEmitter(): EventEmitterInterface;
}

0 comments on commit ac870b0

Please sign in to comment.