Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0 #1

Merged
merged 3 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/"
Expand All @@ -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
Expand Up @@ -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();
Expand All @@ -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
Expand Up @@ -2,6 +2,7 @@

namespace Micro\Plugin\EventEmitter;

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

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

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