From ed76d533d9e8e22ef4987d2c866313eb2f224529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sat, 7 Jan 2017 06:54:12 +0100 Subject: [PATCH 1/9] Closes #150 --- src/Plugin/InvokeStrategy/OnEventStrategy.php | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Plugin/InvokeStrategy/OnEventStrategy.php b/src/Plugin/InvokeStrategy/OnEventStrategy.php index 825778a..6f7a19c 100644 --- a/src/Plugin/InvokeStrategy/OnEventStrategy.php +++ b/src/Plugin/InvokeStrategy/OnEventStrategy.php @@ -12,7 +12,11 @@ namespace Prooph\ServiceBus\Plugin\InvokeStrategy; -class OnEventStrategy extends AbstractInvokeStrategy +use Prooph\ServiceBus\EventBus; +use Prooph\ServiceBus\MessageBus; +use Prooph\ServiceBus\Plugin\AbstractPlugin; + +class OnEventStrategy extends AbstractPlugin { /** * @param mixed $handler @@ -22,4 +26,24 @@ public function invoke($handler, $message): void { $handler->onEvent($message); } + + public function attachToMessageBus(MessageBus $messageBus): void + { + $this->listenerHandlers[] = $messageBus->attach( + MessageBus::EVENT_DISPATCH, + function (ActionEvent $actionEvent): void { + $message = $actionEvent->getParam(MessageBus::EVENT_PARAM_MESSAGE); + $handlers = $actionEvent->getParam(EventBus::EVENT_PARAM_EVENT_LISTENERS); + + foreach ($handlers as $handler) { + $this->invoke($handler, $message); + } + + $actionEvent->setParam(MessageBus::EVENT_PARAM_MESSAGE_HANDLED, true); + }, + MessageBus::PRIORITY_INVOKE_HANDLER + ); + + + } } From f210fcf992392fa534421173fd5ebbf39a4a47e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sat, 7 Jan 2017 07:00:25 +0100 Subject: [PATCH 2/9] Missing import --- src/Plugin/InvokeStrategy/OnEventStrategy.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Plugin/InvokeStrategy/OnEventStrategy.php b/src/Plugin/InvokeStrategy/OnEventStrategy.php index 6f7a19c..fa98bf9 100644 --- a/src/Plugin/InvokeStrategy/OnEventStrategy.php +++ b/src/Plugin/InvokeStrategy/OnEventStrategy.php @@ -12,6 +12,7 @@ namespace Prooph\ServiceBus\Plugin\InvokeStrategy; +use Prooph\Common\Event\ActionEvent; use Prooph\ServiceBus\EventBus; use Prooph\ServiceBus\MessageBus; use Prooph\ServiceBus\Plugin\AbstractPlugin; From 4cd1d7cf37d69ab452bdeacbb8c4a30782cc7cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sat, 7 Jan 2017 07:08:08 +0100 Subject: [PATCH 3/9] Fix CS --- src/Plugin/InvokeStrategy/OnEventStrategy.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Plugin/InvokeStrategy/OnEventStrategy.php b/src/Plugin/InvokeStrategy/OnEventStrategy.php index fa98bf9..7fe9e5e 100644 --- a/src/Plugin/InvokeStrategy/OnEventStrategy.php +++ b/src/Plugin/InvokeStrategy/OnEventStrategy.php @@ -44,7 +44,5 @@ function (ActionEvent $actionEvent): void { }, MessageBus::PRIORITY_INVOKE_HANDLER ); - - } } From aa054129cc9bc9728296d5de4b5388f97e1d87a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sat, 7 Jan 2017 07:13:53 +0100 Subject: [PATCH 4/9] Update copyright to 2017 --- config/prooph_service_bus.config.php | 4 ++-- config/services.php | 4 ++-- examples/quick-start.php | 4 ++-- src/Async/AsyncMessage.php | 4 ++-- src/Async/MessageProducer.php | 4 ++-- src/CommandBus.php | 4 ++-- src/Container/AbstractBusFactory.php | 4 ++-- src/Container/CommandBusFactory.php | 4 ++-- src/Container/EventBusFactory.php | 4 ++-- src/Container/Plugin/Guard/FinalizeGuardFactory.php | 4 ++-- src/Container/Plugin/Guard/RouteGuardFactory.php | 4 ++-- src/Container/QueryBusFactory.php | 4 ++-- src/EventBus.php | 4 ++-- src/Exception/CommandDispatchException.php | 4 ++-- src/Exception/InvalidArgumentException.php | 4 ++-- src/Exception/MessageDispatchException.php | 4 ++-- src/Exception/RuntimeException.php | 4 ++-- src/Exception/ServiceBusException.php | 4 ++-- src/MessageBus.php | 4 ++-- src/Plugin/AbstractPlugin.php | 4 ++-- src/Plugin/Guard/AuthorizationService.php | 4 ++-- src/Plugin/Guard/FinalizeGuard.php | 4 ++-- src/Plugin/Guard/RouteGuard.php | 4 ++-- src/Plugin/Guard/UnauthorizedException.php | 4 ++-- src/Plugin/InvokeStrategy/AbstractInvokeStrategy.php | 4 ++-- src/Plugin/InvokeStrategy/FinderInvokeStrategy.php | 4 ++-- src/Plugin/InvokeStrategy/HandleCommandStrategy.php | 4 ++-- src/Plugin/InvokeStrategy/OnEventStrategy.php | 4 ++-- src/Plugin/MessageFactoryPlugin.php | 4 ++-- src/Plugin/MessageProducerPlugin.php | 4 ++-- src/Plugin/Plugin.php | 4 ++-- src/Plugin/Router/AsyncSwitchMessageRouter.php | 4 ++-- src/Plugin/Router/CommandRouter.php | 4 ++-- src/Plugin/Router/EventRouter.php | 4 ++-- src/Plugin/Router/MessageBusRouterPlugin.php | 4 ++-- src/Plugin/Router/QueryRouter.php | 4 ++-- src/Plugin/Router/RegexRouter.php | 4 ++-- src/Plugin/Router/ServiceLocatorEventRouter.php | 4 ++-- src/Plugin/Router/SingleHandlerRouter.php | 4 ++-- src/Plugin/Router/SingleHandlerServiceLocatorRouter.php | 4 ++-- src/Plugin/ServiceLocatorPlugin.php | 4 ++-- src/QueryBus.php | 4 ++-- tests/CommandBusTest.php | 4 ++-- tests/Container/BusFactoriesTest.php | 4 ++-- tests/Container/Plugin/Guard/FinalizeGuardFactoryTest.php | 4 ++-- tests/Container/Plugin/Guard/RouteGuardFactoryTest.php | 4 ++-- tests/EventBusTest.php | 4 ++-- tests/Exception/CommandDispatchExceptionTest.php | 4 ++-- tests/MessageBusTest.php | 4 ++-- tests/Mock/AsyncCommand.php | 4 ++-- tests/Mock/AsyncEvent.php | 4 ++-- tests/Mock/CustomMessage.php | 4 ++-- tests/Mock/CustomMessageBus.php | 4 ++-- tests/Mock/CustomMessageCommandHandler.php | 4 ++-- tests/Mock/CustomMessageWithName.php | 4 ++-- tests/Mock/DoSomething.php | 4 ++-- tests/Mock/ErrorProducer.php | 4 ++-- tests/Mock/FetchSomething.php | 4 ++-- tests/Mock/Finder.php | 4 ++-- tests/Mock/MessageHandler.php | 4 ++-- tests/Mock/NonAsyncCommand.php | 4 ++-- tests/Mock/NoopMessageProducer.php | 4 ++-- tests/Mock/SomethingDone.php | 4 ++-- tests/Plugin/Guard/FinalizeGuardTest.php | 4 ++-- tests/Plugin/Guard/RouteGuardTest.php | 4 ++-- tests/Plugin/InvokeStrategy/FinderInvokeStrategyTest.php | 4 ++-- tests/Plugin/InvokeStrategy/HandleCommandStrategyTest.php | 4 ++-- tests/Plugin/InvokeStrategy/OnEventStrategyTest.php | 4 ++-- tests/Plugin/MessageFactoryPluginTest.php | 4 ++-- tests/Plugin/MessageProducerPluginTest.php | 4 ++-- tests/Plugin/Router/AsyncSwitchMessageRouterTest.php | 4 ++-- tests/Plugin/Router/EventRouterTest.php | 4 ++-- tests/Plugin/Router/RegexRouterTest.php | 4 ++-- tests/Plugin/Router/ServiceLocatorEventRouterTest.php | 4 ++-- tests/Plugin/Router/SingleHandlerRouterTest.php | 4 ++-- tests/Plugin/Router/SingleHandlerServiceLocatorRouterTest.php | 4 ++-- tests/Plugin/ServiceLocatorPluginTest.php | 4 ++-- tests/QueryBusTest.php | 4 ++-- 78 files changed, 156 insertions(+), 156 deletions(-) diff --git a/config/prooph_service_bus.config.php b/config/prooph_service_bus.config.php index 26bf26c..4e52412 100644 --- a/config/prooph_service_bus.config.php +++ b/config/prooph_service_bus.config.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/config/services.php b/config/services.php index 86a7f8f..09a0396 100644 --- a/config/services.php +++ b/config/services.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/examples/quick-start.php b/examples/quick-start.php index a0bb967..b597c34 100644 --- a/examples/quick-start.php +++ b/examples/quick-start.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Async/AsyncMessage.php b/src/Async/AsyncMessage.php index 16137c4..64ff33d 100644 --- a/src/Async/AsyncMessage.php +++ b/src/Async/AsyncMessage.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Async/MessageProducer.php b/src/Async/MessageProducer.php index d09890b..6cdb9a9 100644 --- a/src/Async/MessageProducer.php +++ b/src/Async/MessageProducer.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/CommandBus.php b/src/CommandBus.php index 84efe2b..80fd0c6 100644 --- a/src/CommandBus.php +++ b/src/CommandBus.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Container/AbstractBusFactory.php b/src/Container/AbstractBusFactory.php index 5ba6f5f..3ef462d 100644 --- a/src/Container/AbstractBusFactory.php +++ b/src/Container/AbstractBusFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Container/CommandBusFactory.php b/src/Container/CommandBusFactory.php index 5cfad31..82b0d9c 100644 --- a/src/Container/CommandBusFactory.php +++ b/src/Container/CommandBusFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Container/EventBusFactory.php b/src/Container/EventBusFactory.php index 922d35f..1d7d236 100644 --- a/src/Container/EventBusFactory.php +++ b/src/Container/EventBusFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Container/Plugin/Guard/FinalizeGuardFactory.php b/src/Container/Plugin/Guard/FinalizeGuardFactory.php index 0a05f4f..a2ed120 100644 --- a/src/Container/Plugin/Guard/FinalizeGuardFactory.php +++ b/src/Container/Plugin/Guard/FinalizeGuardFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Container/Plugin/Guard/RouteGuardFactory.php b/src/Container/Plugin/Guard/RouteGuardFactory.php index 2439304..e2247e7 100644 --- a/src/Container/Plugin/Guard/RouteGuardFactory.php +++ b/src/Container/Plugin/Guard/RouteGuardFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Container/QueryBusFactory.php b/src/Container/QueryBusFactory.php index ee84799..72e3752 100644 --- a/src/Container/QueryBusFactory.php +++ b/src/Container/QueryBusFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/EventBus.php b/src/EventBus.php index 7b4a125..f387c1c 100644 --- a/src/EventBus.php +++ b/src/EventBus.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Exception/CommandDispatchException.php b/src/Exception/CommandDispatchException.php index f1210d9..021ee33 100644 --- a/src/Exception/CommandDispatchException.php +++ b/src/Exception/CommandDispatchException.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 09dc7fd..04300ed 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Exception/MessageDispatchException.php b/src/Exception/MessageDispatchException.php index 25f1db9..dafa90d 100644 --- a/src/Exception/MessageDispatchException.php +++ b/src/Exception/MessageDispatchException.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index 28ae8ce..8344648 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Exception/ServiceBusException.php b/src/Exception/ServiceBusException.php index 5f2813a..dcd913a 100644 --- a/src/Exception/ServiceBusException.php +++ b/src/Exception/ServiceBusException.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/MessageBus.php b/src/MessageBus.php index a430b01..d6f76a9 100644 --- a/src/MessageBus.php +++ b/src/MessageBus.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/AbstractPlugin.php b/src/Plugin/AbstractPlugin.php index 0ab4049..fe85845 100644 --- a/src/Plugin/AbstractPlugin.php +++ b/src/Plugin/AbstractPlugin.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Guard/AuthorizationService.php b/src/Plugin/Guard/AuthorizationService.php index aaaac79..4b559e2 100644 --- a/src/Plugin/Guard/AuthorizationService.php +++ b/src/Plugin/Guard/AuthorizationService.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Guard/FinalizeGuard.php b/src/Plugin/Guard/FinalizeGuard.php index 064ee4c..daf75e3 100644 --- a/src/Plugin/Guard/FinalizeGuard.php +++ b/src/Plugin/Guard/FinalizeGuard.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Guard/RouteGuard.php b/src/Plugin/Guard/RouteGuard.php index 1371121..a7aa0fb 100644 --- a/src/Plugin/Guard/RouteGuard.php +++ b/src/Plugin/Guard/RouteGuard.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Guard/UnauthorizedException.php b/src/Plugin/Guard/UnauthorizedException.php index 9fa7ed4..a7d3b4a 100644 --- a/src/Plugin/Guard/UnauthorizedException.php +++ b/src/Plugin/Guard/UnauthorizedException.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/InvokeStrategy/AbstractInvokeStrategy.php b/src/Plugin/InvokeStrategy/AbstractInvokeStrategy.php index ab15562..300b33a 100644 --- a/src/Plugin/InvokeStrategy/AbstractInvokeStrategy.php +++ b/src/Plugin/InvokeStrategy/AbstractInvokeStrategy.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/InvokeStrategy/FinderInvokeStrategy.php b/src/Plugin/InvokeStrategy/FinderInvokeStrategy.php index 209a146..673359d 100644 --- a/src/Plugin/InvokeStrategy/FinderInvokeStrategy.php +++ b/src/Plugin/InvokeStrategy/FinderInvokeStrategy.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/InvokeStrategy/HandleCommandStrategy.php b/src/Plugin/InvokeStrategy/HandleCommandStrategy.php index 2055aa4..a29125a 100644 --- a/src/Plugin/InvokeStrategy/HandleCommandStrategy.php +++ b/src/Plugin/InvokeStrategy/HandleCommandStrategy.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/InvokeStrategy/OnEventStrategy.php b/src/Plugin/InvokeStrategy/OnEventStrategy.php index 7fe9e5e..cf8731d 100644 --- a/src/Plugin/InvokeStrategy/OnEventStrategy.php +++ b/src/Plugin/InvokeStrategy/OnEventStrategy.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/MessageFactoryPlugin.php b/src/Plugin/MessageFactoryPlugin.php index 1174b73..a57fe66 100644 --- a/src/Plugin/MessageFactoryPlugin.php +++ b/src/Plugin/MessageFactoryPlugin.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/MessageProducerPlugin.php b/src/Plugin/MessageProducerPlugin.php index fd7cd4c..20576ab 100644 --- a/src/Plugin/MessageProducerPlugin.php +++ b/src/Plugin/MessageProducerPlugin.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Plugin.php b/src/Plugin/Plugin.php index 919e2c0..57bd827 100644 --- a/src/Plugin/Plugin.php +++ b/src/Plugin/Plugin.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/AsyncSwitchMessageRouter.php b/src/Plugin/Router/AsyncSwitchMessageRouter.php index 65e45db..e880c26 100644 --- a/src/Plugin/Router/AsyncSwitchMessageRouter.php +++ b/src/Plugin/Router/AsyncSwitchMessageRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/CommandRouter.php b/src/Plugin/Router/CommandRouter.php index c1e716a..ee61a14 100644 --- a/src/Plugin/Router/CommandRouter.php +++ b/src/Plugin/Router/CommandRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/EventRouter.php b/src/Plugin/Router/EventRouter.php index 2491fb7..3dc1d93 100644 --- a/src/Plugin/Router/EventRouter.php +++ b/src/Plugin/Router/EventRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/MessageBusRouterPlugin.php b/src/Plugin/Router/MessageBusRouterPlugin.php index 2b7130c..5c7ab5b 100644 --- a/src/Plugin/Router/MessageBusRouterPlugin.php +++ b/src/Plugin/Router/MessageBusRouterPlugin.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/QueryRouter.php b/src/Plugin/Router/QueryRouter.php index ec1a3b0..1829794 100644 --- a/src/Plugin/Router/QueryRouter.php +++ b/src/Plugin/Router/QueryRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/RegexRouter.php b/src/Plugin/Router/RegexRouter.php index 002728a..cadc33c 100644 --- a/src/Plugin/Router/RegexRouter.php +++ b/src/Plugin/Router/RegexRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/ServiceLocatorEventRouter.php b/src/Plugin/Router/ServiceLocatorEventRouter.php index 14827b6..da59ad3 100644 --- a/src/Plugin/Router/ServiceLocatorEventRouter.php +++ b/src/Plugin/Router/ServiceLocatorEventRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/SingleHandlerRouter.php b/src/Plugin/Router/SingleHandlerRouter.php index 117dc64..bd764c0 100644 --- a/src/Plugin/Router/SingleHandlerRouter.php +++ b/src/Plugin/Router/SingleHandlerRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/Router/SingleHandlerServiceLocatorRouter.php b/src/Plugin/Router/SingleHandlerServiceLocatorRouter.php index 5ce75d1..046d6c1 100644 --- a/src/Plugin/Router/SingleHandlerServiceLocatorRouter.php +++ b/src/Plugin/Router/SingleHandlerServiceLocatorRouter.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Plugin/ServiceLocatorPlugin.php b/src/Plugin/ServiceLocatorPlugin.php index 1a4609b..92c0972 100644 --- a/src/Plugin/ServiceLocatorPlugin.php +++ b/src/Plugin/ServiceLocatorPlugin.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/QueryBus.php b/src/QueryBus.php index 6abc4b4..dc940af 100644 --- a/src/QueryBus.php +++ b/src/QueryBus.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/CommandBusTest.php b/tests/CommandBusTest.php index 6ed243f..75a03c5 100644 --- a/tests/CommandBusTest.php +++ b/tests/CommandBusTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Container/BusFactoriesTest.php b/tests/Container/BusFactoriesTest.php index 05ddd3c..26bd378 100644 --- a/tests/Container/BusFactoriesTest.php +++ b/tests/Container/BusFactoriesTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Container/Plugin/Guard/FinalizeGuardFactoryTest.php b/tests/Container/Plugin/Guard/FinalizeGuardFactoryTest.php index c439153..c68d135 100644 --- a/tests/Container/Plugin/Guard/FinalizeGuardFactoryTest.php +++ b/tests/Container/Plugin/Guard/FinalizeGuardFactoryTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Container/Plugin/Guard/RouteGuardFactoryTest.php b/tests/Container/Plugin/Guard/RouteGuardFactoryTest.php index 9085497..4a4786c 100644 --- a/tests/Container/Plugin/Guard/RouteGuardFactoryTest.php +++ b/tests/Container/Plugin/Guard/RouteGuardFactoryTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/EventBusTest.php b/tests/EventBusTest.php index 4180cff..f78d86c 100644 --- a/tests/EventBusTest.php +++ b/tests/EventBusTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Exception/CommandDispatchExceptionTest.php b/tests/Exception/CommandDispatchExceptionTest.php index 2806f92..1a3d8e6 100644 --- a/tests/Exception/CommandDispatchExceptionTest.php +++ b/tests/Exception/CommandDispatchExceptionTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/MessageBusTest.php b/tests/MessageBusTest.php index dd78d63..7cd5a21 100644 --- a/tests/MessageBusTest.php +++ b/tests/MessageBusTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/AsyncCommand.php b/tests/Mock/AsyncCommand.php index 192a7a7..7a1fa9d 100644 --- a/tests/Mock/AsyncCommand.php +++ b/tests/Mock/AsyncCommand.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/AsyncEvent.php b/tests/Mock/AsyncEvent.php index eabc2b2..2cf90cc 100644 --- a/tests/Mock/AsyncEvent.php +++ b/tests/Mock/AsyncEvent.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/CustomMessage.php b/tests/Mock/CustomMessage.php index a716160..24a8e51 100644 --- a/tests/Mock/CustomMessage.php +++ b/tests/Mock/CustomMessage.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/CustomMessageBus.php b/tests/Mock/CustomMessageBus.php index a38fe41..8e241c5 100644 --- a/tests/Mock/CustomMessageBus.php +++ b/tests/Mock/CustomMessageBus.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/CustomMessageCommandHandler.php b/tests/Mock/CustomMessageCommandHandler.php index 4f5c0d0..9c2d9ba 100644 --- a/tests/Mock/CustomMessageCommandHandler.php +++ b/tests/Mock/CustomMessageCommandHandler.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/CustomMessageWithName.php b/tests/Mock/CustomMessageWithName.php index 43f67a5..0ecf64b 100644 --- a/tests/Mock/CustomMessageWithName.php +++ b/tests/Mock/CustomMessageWithName.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/DoSomething.php b/tests/Mock/DoSomething.php index 0623a8d..f168bf1 100644 --- a/tests/Mock/DoSomething.php +++ b/tests/Mock/DoSomething.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/ErrorProducer.php b/tests/Mock/ErrorProducer.php index b70b5ca..09dcfa4 100644 --- a/tests/Mock/ErrorProducer.php +++ b/tests/Mock/ErrorProducer.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/FetchSomething.php b/tests/Mock/FetchSomething.php index 3907896..5d576ab 100644 --- a/tests/Mock/FetchSomething.php +++ b/tests/Mock/FetchSomething.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/Finder.php b/tests/Mock/Finder.php index 6046d00..b5e7261 100644 --- a/tests/Mock/Finder.php +++ b/tests/Mock/Finder.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/MessageHandler.php b/tests/Mock/MessageHandler.php index 6a77264..ba041e2 100644 --- a/tests/Mock/MessageHandler.php +++ b/tests/Mock/MessageHandler.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/NonAsyncCommand.php b/tests/Mock/NonAsyncCommand.php index e9be60e..1deae2b 100644 --- a/tests/Mock/NonAsyncCommand.php +++ b/tests/Mock/NonAsyncCommand.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/NoopMessageProducer.php b/tests/Mock/NoopMessageProducer.php index 6c0d25d..7673335 100644 --- a/tests/Mock/NoopMessageProducer.php +++ b/tests/Mock/NoopMessageProducer.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/SomethingDone.php b/tests/Mock/SomethingDone.php index f1f1a96..509b04b 100644 --- a/tests/Mock/SomethingDone.php +++ b/tests/Mock/SomethingDone.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Guard/FinalizeGuardTest.php b/tests/Plugin/Guard/FinalizeGuardTest.php index 91e8cec..7e145bd 100644 --- a/tests/Plugin/Guard/FinalizeGuardTest.php +++ b/tests/Plugin/Guard/FinalizeGuardTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Guard/RouteGuardTest.php b/tests/Plugin/Guard/RouteGuardTest.php index b2df65c..3f3aa7f 100644 --- a/tests/Plugin/Guard/RouteGuardTest.php +++ b/tests/Plugin/Guard/RouteGuardTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/InvokeStrategy/FinderInvokeStrategyTest.php b/tests/Plugin/InvokeStrategy/FinderInvokeStrategyTest.php index f87181b..096b268 100644 --- a/tests/Plugin/InvokeStrategy/FinderInvokeStrategyTest.php +++ b/tests/Plugin/InvokeStrategy/FinderInvokeStrategyTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/InvokeStrategy/HandleCommandStrategyTest.php b/tests/Plugin/InvokeStrategy/HandleCommandStrategyTest.php index 7cb46de..d0d8815 100644 --- a/tests/Plugin/InvokeStrategy/HandleCommandStrategyTest.php +++ b/tests/Plugin/InvokeStrategy/HandleCommandStrategyTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php index 2420b55..f5971b1 100644 --- a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php +++ b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/MessageFactoryPluginTest.php b/tests/Plugin/MessageFactoryPluginTest.php index 6b4d497..268d6a6 100644 --- a/tests/Plugin/MessageFactoryPluginTest.php +++ b/tests/Plugin/MessageFactoryPluginTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/MessageProducerPluginTest.php b/tests/Plugin/MessageProducerPluginTest.php index 90e307d..3b55034 100644 --- a/tests/Plugin/MessageProducerPluginTest.php +++ b/tests/Plugin/MessageProducerPluginTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Router/AsyncSwitchMessageRouterTest.php b/tests/Plugin/Router/AsyncSwitchMessageRouterTest.php index 39e0f81..03f19cf 100644 --- a/tests/Plugin/Router/AsyncSwitchMessageRouterTest.php +++ b/tests/Plugin/Router/AsyncSwitchMessageRouterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Router/EventRouterTest.php b/tests/Plugin/Router/EventRouterTest.php index d8312c8..468b18e 100644 --- a/tests/Plugin/Router/EventRouterTest.php +++ b/tests/Plugin/Router/EventRouterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Router/RegexRouterTest.php b/tests/Plugin/Router/RegexRouterTest.php index c81d956..7aa16ac 100644 --- a/tests/Plugin/Router/RegexRouterTest.php +++ b/tests/Plugin/Router/RegexRouterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Router/ServiceLocatorEventRouterTest.php b/tests/Plugin/Router/ServiceLocatorEventRouterTest.php index 6a73d19..e03f524 100644 --- a/tests/Plugin/Router/ServiceLocatorEventRouterTest.php +++ b/tests/Plugin/Router/ServiceLocatorEventRouterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Router/SingleHandlerRouterTest.php b/tests/Plugin/Router/SingleHandlerRouterTest.php index 920244b..fc41b76 100644 --- a/tests/Plugin/Router/SingleHandlerRouterTest.php +++ b/tests/Plugin/Router/SingleHandlerRouterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/Router/SingleHandlerServiceLocatorRouterTest.php b/tests/Plugin/Router/SingleHandlerServiceLocatorRouterTest.php index 6cca247..8631065 100644 --- a/tests/Plugin/Router/SingleHandlerServiceLocatorRouterTest.php +++ b/tests/Plugin/Router/SingleHandlerServiceLocatorRouterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Plugin/ServiceLocatorPluginTest.php b/tests/Plugin/ServiceLocatorPluginTest.php index 43e4ff3..1999bdc 100644 --- a/tests/Plugin/ServiceLocatorPluginTest.php +++ b/tests/Plugin/ServiceLocatorPluginTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/QueryBusTest.php b/tests/QueryBusTest.php index 1b76728..0030d0b 100644 --- a/tests/QueryBusTest.php +++ b/tests/QueryBusTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2016 Sascha-Oliver Prolic + * (c) 2014-2017 prooph software GmbH + * (c) 2015-2017 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. From a9bd5c130b868508e5b383360d8eacdab296df1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sat, 7 Jan 2017 07:23:14 +0100 Subject: [PATCH 5/9] Update Copyright Date in LICENCE --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 0f30df1..d9963f0 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2013, Alexander Miertsch contact@prooph.de +Copyright (c) 2017, Alexander Miertsch contact@prooph.de All rights reserved. Redistribution and use in source and binary forms, with or without modification, From c26c70df40b45b1f8bb9241fd9ab1fd9c8d6e7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sat, 7 Jan 2017 07:39:42 +0100 Subject: [PATCH 6/9] Fix LICENCE headers --- LICENSE.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index d9963f0..a7200a7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,5 @@ -Copyright (c) 2017, Alexander Miertsch contact@prooph.de +Copyright (c) 2013-2017, prooph software GmbH +Copyright (c) 2015-2017, Sascha-Oliver Prolic All rights reserved. Redistribution and use in source and binary forms, with or without modification, From 8cc2ad91d505f77361ac66650059283d93337c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Sun, 8 Jan 2017 18:08:10 +0100 Subject: [PATCH 7/9] Add missing testcase --- .../InvokeStrategy/OnEventStrategyTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php index f5971b1..142b8de 100644 --- a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php +++ b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php @@ -13,9 +13,12 @@ namespace ProophTest\ServiceBus\Plugin\InvokeStrategy; use PHPUnit\Framework\TestCase; +use Prooph\Common\Event\DefaultListenerHandler; +use Prooph\ServiceBus\EventBus; use Prooph\ServiceBus\Plugin\InvokeStrategy\OnEventStrategy; use ProophTest\ServiceBus\Mock\CustomMessage; use ProophTest\ServiceBus\Mock\MessageHandler; +use Prophecy\Argument; class OnEventStrategyTest extends TestCase { @@ -34,4 +37,23 @@ public function it_invokes_the_on_event_method_of_the_handler(): void $this->assertSame($customEvent, $onEventHandler->getLastMessage()); } + + /** + * @test + */ + public function it_can_be_attached_to_event_bus(): void + { + $onEventStrategy = new OnEventStrategy(); + + $prophet = new \Prophecy\Prophet(); + + $bus = $prophet->prophesize(EventBus::class); + $bus->attach(Argument::type('string'), Argument::type('callable'), Argument::type('integer'))->willReturn(new DefaultListenerHandler(function () { + })); + + $onEventStrategy->attachToMessageBus($bus->reveal()); + + $bus->attach(Argument::type('string'), Argument::type('callable'), Argument::type('integer'))->shouldHaveBeenCalled(); + $prophet->checkPredictions(); + } } From 3a22bc3f60777310c0f5d8210fe4ba4f65ccd9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Mon, 9 Jan 2017 15:24:42 +0100 Subject: [PATCH 8/9] Better Testcase, thanks @oqq --- .../InvokeStrategy/OnEventStrategyTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php index 142b8de..1d1a9e8 100644 --- a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php +++ b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php @@ -45,15 +45,17 @@ public function it_can_be_attached_to_event_bus(): void { $onEventStrategy = new OnEventStrategy(); - $prophet = new \Prophecy\Prophet(); + $bus = $this->prophesize(EventBus::class); + $bus->attach(Argument::type('string'), Argument::type('callable'), Argument::type('integer')) + ->shouldBeCalled() + ->willReturn( + new DefaultListenerHandler( + function () { - $bus = $prophet->prophesize(EventBus::class); - $bus->attach(Argument::type('string'), Argument::type('callable'), Argument::type('integer'))->willReturn(new DefaultListenerHandler(function () { - })); + } + ) + ); $onEventStrategy->attachToMessageBus($bus->reveal()); - - $bus->attach(Argument::type('string'), Argument::type('callable'), Argument::type('integer'))->shouldHaveBeenCalled(); - $prophet->checkPredictions(); } } From 34e7fb6bf206a87674492b5c625b1f258babf96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bl=C3=A4ttermann?= Date: Mon, 9 Jan 2017 21:00:31 +0100 Subject: [PATCH 9/9] Remove OnEventStrategy::invoke() and make class final --- src/Plugin/InvokeStrategy/OnEventStrategy.php | 13 ++----- tests/Mock/CustomMessageEventHandler.php | 36 +++++++++++++++++++ .../InvokeStrategy/OnEventStrategyTest.php | 18 +++++++--- 3 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 tests/Mock/CustomMessageEventHandler.php diff --git a/src/Plugin/InvokeStrategy/OnEventStrategy.php b/src/Plugin/InvokeStrategy/OnEventStrategy.php index cf8731d..61f237f 100644 --- a/src/Plugin/InvokeStrategy/OnEventStrategy.php +++ b/src/Plugin/InvokeStrategy/OnEventStrategy.php @@ -17,17 +17,8 @@ use Prooph\ServiceBus\MessageBus; use Prooph\ServiceBus\Plugin\AbstractPlugin; -class OnEventStrategy extends AbstractPlugin +final class OnEventStrategy extends AbstractPlugin { - /** - * @param mixed $handler - * @param mixed $message - */ - public function invoke($handler, $message): void - { - $handler->onEvent($message); - } - public function attachToMessageBus(MessageBus $messageBus): void { $this->listenerHandlers[] = $messageBus->attach( @@ -37,7 +28,7 @@ function (ActionEvent $actionEvent): void { $handlers = $actionEvent->getParam(EventBus::EVENT_PARAM_EVENT_LISTENERS); foreach ($handlers as $handler) { - $this->invoke($handler, $message); + $handler->onEvent($message); } $actionEvent->setParam(MessageBus::EVENT_PARAM_MESSAGE_HANDLED, true); diff --git a/tests/Mock/CustomMessageEventHandler.php b/tests/Mock/CustomMessageEventHandler.php new file mode 100644 index 0000000..becf36f --- /dev/null +++ b/tests/Mock/CustomMessageEventHandler.php @@ -0,0 +1,36 @@ + + * (c) 2015-2017 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ProophTest\ServiceBus\Mock; + +final class CustomMessageEventHandler +{ + private $lastMessage; + + private $invokeCounter = 0; + + public function onEvent($message): void + { + $this->lastMessage = $message; + $this->invokeCounter++; + } + + public function getLastMessage() + { + return $this->lastMessage; + } + + public function getInvokeCounter(): int + { + return $this->invokeCounter; + } +} diff --git a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php index 1d1a9e8..e2fa813 100644 --- a/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php +++ b/tests/Plugin/InvokeStrategy/OnEventStrategyTest.php @@ -16,8 +16,9 @@ use Prooph\Common\Event\DefaultListenerHandler; use Prooph\ServiceBus\EventBus; use Prooph\ServiceBus\Plugin\InvokeStrategy\OnEventStrategy; +use Prooph\ServiceBus\Plugin\Router\EventRouter; use ProophTest\ServiceBus\Mock\CustomMessage; -use ProophTest\ServiceBus\Mock\MessageHandler; +use ProophTest\ServiceBus\Mock\CustomMessageEventHandler; use Prophecy\Argument; class OnEventStrategyTest extends TestCase @@ -27,15 +28,23 @@ class OnEventStrategyTest extends TestCase */ public function it_invokes_the_on_event_method_of_the_handler(): void { + $eventBus = new EventBus(); + $onEventStrategy = new OnEventStrategy(); + $onEventStrategy->attachToMessageBus($eventBus); - $customEvent = new CustomMessage('I am an event'); + $onEventHandler = new CustomMessageEventHandler(); - $onEventHandler = new MessageHandler(); + $eventRouter = new EventRouter([ + 'ProophTest\ServiceBus\Mock\CustomMessage' => $onEventHandler, + ]); + $eventRouter->attachToMessageBus($eventBus); - $onEventStrategy->invoke($onEventHandler, $customEvent); + $customEvent = new CustomMessage('I am an event'); + $eventBus->dispatch($customEvent); $this->assertSame($customEvent, $onEventHandler->getLastMessage()); + $this->assertSame(1, $onEventHandler->getInvokeCounter()); } /** @@ -51,7 +60,6 @@ public function it_can_be_attached_to_event_bus(): void ->willReturn( new DefaultListenerHandler( function () { - } ) );