From b686805dcbf67a101bc634abeca7137f1b4cd9da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Guti=C3=A9rrez?= Date: Sun, 3 Feb 2019 15:13:34 +0100 Subject: [PATCH] update NS --- README.md | 10 +++++----- composer.json | 4 ++-- phpunit.xml.dist | 2 +- src/ContainerAwareDispatcher.php | 2 +- src/Dispatcher.php | 2 +- src/EventBus.php | 2 +- src/EventDispatcher.php | 2 +- src/EventEnvelope.php | 2 +- .../ContainerAwareDispatcherTest.php | 10 +++++----- tests/{Symfony => Dispatcher}/DispatcherTest.php | 10 +++++----- tests/{Symfony => Dispatcher}/EventBusTest.php | 8 ++++---- tests/{Symfony => Dispatcher}/EventEnvelopeTest.php | 6 +++--- tests/{Symfony => Dispatcher}/Stub/EventStub.php | 2 +- .../Stub/EventSubscriberInterfaceStub.php | 2 +- 14 files changed, 32 insertions(+), 32 deletions(-) rename tests/{Symfony => Dispatcher}/ContainerAwareDispatcherTest.php (93%) rename tests/{Symfony => Dispatcher}/DispatcherTest.php (88%) rename tests/{Symfony => Dispatcher}/EventBusTest.php (80%) rename tests/{Symfony => Dispatcher}/EventEnvelopeTest.php (80%) rename tests/{Symfony => Dispatcher}/Stub/EventStub.php (91%) rename tests/{Symfony => Dispatcher}/Stub/EventSubscriberInterfaceStub.php (94%) diff --git a/README.md b/README.md index 0c177a2..9a8e4ef 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,16 @@ require './vendor/autoload.php'; ### Events Bus ```php -use Gears\Event\Symfony\ContainerAwareEventDispatcher; -use Gears\Event\Symfony\EventBus; -use Gears\Event\Symfony\EventDispatcher; +use Gears\Event\Symfony\Dispatcher\ContainerAwareDispatcher; +use Gears\Event\Symfony\Dispatcher\EventBus; +use Gears\Event\Symfony\Dispatcher\Dispatcher; $eventToHandlerMap = []; -$symfonyDispatcher = new EventDispatcher($eventToHandlerMap); +$symfonyDispatcher = new Dispatcher($eventToHandlerMap); // OR /** @var \Psr\Container\ContainerInterface $container */ -$symfonyDispatcher = new ContainerAwareEventDispatcher($container, $eventToHandlerMap); +$symfonyDispatcher = new ContainerAwareDispatcher($container, $eventToHandlerMap); $eventBus = new EventBus($symfonyDispatcher); diff --git a/composer.json b/composer.json index a7766a5..67742f7 100644 --- a/composer.json +++ b/composer.json @@ -46,12 +46,12 @@ }, "autoload": { "psr-4": { - "Gears\\Event\\Symfony\\": "src/" + "Gears\\Event\\Symfony\\Dispatcher\\": "src/" } }, "autoload-dev": { "psr-4": { - "Gears\\Event\\Symfony\\Tests\\": "tests/Symfony/" + "Gears\\Event\\Symfony\\Dispatcher\\Tests\\": "tests/Dispatcher/" } }, "bin": [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9e1b362..a3ea320 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ > - tests/Symfony/ + tests/Dispatcher/ diff --git a/src/ContainerAwareDispatcher.php b/src/ContainerAwareDispatcher.php index 0ccff99..4ee8ac0 100644 --- a/src/ContainerAwareDispatcher.php +++ b/src/ContainerAwareDispatcher.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony; +namespace Gears\Event\Symfony\Dispatcher; use Gears\Event\EventHandler; use Psr\Container\ContainerInterface; diff --git a/src/Dispatcher.php b/src/Dispatcher.php index 30d2a01..4243c47 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony; +namespace Gears\Event\Symfony\Dispatcher; use Gears\Event\EventHandler; use Symfony\Component\EventDispatcher\Event as SymfonyEvent; diff --git a/src/EventBus.php b/src/EventBus.php index 55656cf..1e69139 100644 --- a/src/EventBus.php +++ b/src/EventBus.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony; +namespace Gears\Event\Symfony\Dispatcher; use Gears\Event\Event; use Gears\Event\EventBus as EventBusInterface; diff --git a/src/EventDispatcher.php b/src/EventDispatcher.php index 3ba03ad..f2e0d1e 100644 --- a/src/EventDispatcher.php +++ b/src/EventDispatcher.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony; +namespace Gears\Event\Symfony\Dispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; diff --git a/src/EventEnvelope.php b/src/EventEnvelope.php index 6704dd6..385f924 100644 --- a/src/EventEnvelope.php +++ b/src/EventEnvelope.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony; +namespace Gears\Event\Symfony\Dispatcher; use Gears\Event\Event; use Symfony\Component\EventDispatcher\Event as SymfonyEvent; diff --git a/tests/Symfony/ContainerAwareDispatcherTest.php b/tests/Dispatcher/ContainerAwareDispatcherTest.php similarity index 93% rename from tests/Symfony/ContainerAwareDispatcherTest.php rename to tests/Dispatcher/ContainerAwareDispatcherTest.php index c688989..cdd620a 100644 --- a/tests/Symfony/ContainerAwareDispatcherTest.php +++ b/tests/Dispatcher/ContainerAwareDispatcherTest.php @@ -11,13 +11,13 @@ declare(strict_types=1); -namespace Gears\Event\Symfony\Tests; +namespace Gears\Event\Symfony\Dispatcher\Tests; use Gears\Event\EventHandler; -use Gears\Event\Symfony\ContainerAwareDispatcher; -use Gears\Event\Symfony\EventEnvelope; -use Gears\Event\Symfony\Tests\Stub\EventStub; -use Gears\Event\Symfony\Tests\Stub\EventSubscriberInterfaceStub; +use Gears\Event\Symfony\Dispatcher\ContainerAwareDispatcher; +use Gears\Event\Symfony\Dispatcher\EventEnvelope; +use Gears\Event\Symfony\Dispatcher\Tests\Stub\EventStub; +use Gears\Event\Symfony\Dispatcher\Tests\Stub\EventSubscriberInterfaceStub; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Symfony\Component\EventDispatcher\Event; diff --git a/tests/Symfony/DispatcherTest.php b/tests/Dispatcher/DispatcherTest.php similarity index 88% rename from tests/Symfony/DispatcherTest.php rename to tests/Dispatcher/DispatcherTest.php index 2f0a293..13b93d3 100644 --- a/tests/Symfony/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -11,13 +11,13 @@ declare(strict_types=1); -namespace Gears\Event\Symfony\Tests; +namespace Gears\Event\Symfony\Dispatcher\Tests; use Gears\Event\EventHandler; -use Gears\Event\Symfony\Dispatcher; -use Gears\Event\Symfony\EventEnvelope; -use Gears\Event\Symfony\Tests\Stub\EventStub; -use Gears\Event\Symfony\Tests\Stub\EventSubscriberInterfaceStub; +use Gears\Event\Symfony\Dispatcher\Dispatcher; +use Gears\Event\Symfony\Dispatcher\EventEnvelope; +use Gears\Event\Symfony\Dispatcher\Tests\Stub\EventStub; +use Gears\Event\Symfony\Dispatcher\Tests\Stub\EventSubscriberInterfaceStub; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\Event; diff --git a/tests/Symfony/EventBusTest.php b/tests/Dispatcher/EventBusTest.php similarity index 80% rename from tests/Symfony/EventBusTest.php rename to tests/Dispatcher/EventBusTest.php index ababb49..0f526a7 100644 --- a/tests/Symfony/EventBusTest.php +++ b/tests/Dispatcher/EventBusTest.php @@ -11,11 +11,11 @@ declare(strict_types=1); -namespace Gears\Event\Symfony\Tests; +namespace Gears\Event\Symfony\Dispatcher\Tests; -use Gears\Event\Symfony\ContainerAwareDispatcher; -use Gears\Event\Symfony\EventBus; -use Gears\Event\Symfony\Tests\Stub\EventStub; +use Gears\Event\Symfony\Dispatcher\ContainerAwareDispatcher; +use Gears\Event\Symfony\Dispatcher\EventBus; +use Gears\Event\Symfony\Dispatcher\Tests\Stub\EventStub; use PHPUnit\Framework\TestCase; /** diff --git a/tests/Symfony/EventEnvelopeTest.php b/tests/Dispatcher/EventEnvelopeTest.php similarity index 80% rename from tests/Symfony/EventEnvelopeTest.php rename to tests/Dispatcher/EventEnvelopeTest.php index 51530a3..bbf93b7 100644 --- a/tests/Symfony/EventEnvelopeTest.php +++ b/tests/Dispatcher/EventEnvelopeTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Gears\Event\Symfony\Tests; +namespace Gears\Event\Symfony\Dispatcher\Tests; -use Gears\Event\Symfony\EventEnvelope; -use Gears\Event\Symfony\Tests\Stub\EventStub; +use Gears\Event\Symfony\Dispatcher\EventEnvelope; +use Gears\Event\Symfony\Dispatcher\Tests\Stub\EventStub; use PHPUnit\Framework\TestCase; /** diff --git a/tests/Symfony/Stub/EventStub.php b/tests/Dispatcher/Stub/EventStub.php similarity index 91% rename from tests/Symfony/Stub/EventStub.php rename to tests/Dispatcher/Stub/EventStub.php index 39232e8..64485ad 100644 --- a/tests/Symfony/Stub/EventStub.php +++ b/tests/Dispatcher/Stub/EventStub.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony\Tests\Stub; +namespace Gears\Event\Symfony\Dispatcher\Tests\Stub; use Gears\Event\AbstractEmptyEvent; diff --git a/tests/Symfony/Stub/EventSubscriberInterfaceStub.php b/tests/Dispatcher/Stub/EventSubscriberInterfaceStub.php similarity index 94% rename from tests/Symfony/Stub/EventSubscriberInterfaceStub.php rename to tests/Dispatcher/Stub/EventSubscriberInterfaceStub.php index 4572897..633c5d2 100644 --- a/tests/Symfony/Stub/EventSubscriberInterfaceStub.php +++ b/tests/Dispatcher/Stub/EventSubscriberInterfaceStub.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Gears\Event\Symfony\Tests\Stub; +namespace Gears\Event\Symfony\Dispatcher\Tests\Stub; use Symfony\Component\EventDispatcher\EventSubscriberInterface;