From 1c1e89fb0578f48cc8e41bef1858c002eeb2ee7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Thu, 22 Mar 2018 12:34:00 +0100 Subject: [PATCH 1/2] Fix DomainMessage metadata bottleneck --- src/Messaging/DomainMessage.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Messaging/DomainMessage.php b/src/Messaging/DomainMessage.php index c0303e1..bb0c301 100644 --- a/src/Messaging/DomainMessage.php +++ b/src/Messaging/DomainMessage.php @@ -111,11 +111,11 @@ public function messageName(): string public function withMetadata(array $metadata): Message { - $messageData = $this->toArray(); + $message = clone $this; - $messageData['metadata'] = $metadata; + $message->metadata = $metadata; - return static::fromArray($messageData); + return $message; } /** @@ -127,10 +127,10 @@ public function withAddedMetadata(string $key, $value): Message { Assertion::notEmpty($key, 'Invalid key'); - $messageData = $this->toArray(); + $message = clone $this; - $messageData['metadata'][$key] = $value; + $message->metadata[$key] = $value; - return static::fromArray($messageData); + return $message; } } From 997b69f27e5c155141b9fb5c53cfb2c49a68fd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Thu, 22 Mar 2018 15:09:02 +0100 Subject: [PATCH 2/2] Update copyright to 2018 --- LICENSE | 4 ++-- src/Event/ActionEvent.php | 4 ++-- src/Event/ActionEventEmitter.php | 4 ++-- src/Event/ActionEventListenerAggregate.php | 4 ++-- src/Event/DefaultActionEvent.php | 4 ++-- src/Event/DefaultListenerHandler.php | 4 ++-- src/Event/DetachAggregateHandlers.php | 4 ++-- src/Event/ListenerHandler.php | 4 ++-- src/Event/ProophActionEventEmitter.php | 4 ++-- src/Messaging/Command.php | 4 ++-- src/Messaging/DomainEvent.php | 4 ++-- src/Messaging/DomainMessage.php | 4 ++-- src/Messaging/FQCNMessageFactory.php | 4 ++-- src/Messaging/HasMessageName.php | 4 ++-- src/Messaging/Message.php | 4 ++-- src/Messaging/MessageConverter.php | 4 ++-- src/Messaging/MessageDataAssertion.php | 4 ++-- src/Messaging/MessageFactory.php | 4 ++-- src/Messaging/NoOpMessageConverter.php | 4 ++-- src/Messaging/PayloadConstructable.php | 4 ++-- src/Messaging/PayloadTrait.php | 4 ++-- src/Messaging/Query.php | 4 ++-- tests/Event/DefaultActionEventTest.php | 4 ++-- tests/Event/ProophActionEventEmitterTest.php | 4 ++-- tests/Messaging/CommandTest.php | 4 ++-- tests/Messaging/DomainEventTest.php | 4 ++-- tests/Messaging/FQCNMessageFactoryTest.php | 4 ++-- tests/Messaging/MessageDataAssertionTest.php | 4 ++-- tests/Messaging/NoOpMessageConverterTest.php | 4 ++-- tests/Messaging/QueryTest.php | 4 ++-- tests/Mock/ActionEventListenerMock.php | 4 ++-- tests/Mock/ActionListenerAggregateMock.php | 4 ++-- tests/Mock/AskSomething.php | 4 ++-- tests/Mock/DoSomething.php | 4 ++-- tests/Mock/InvalidMessage.php | 4 ++-- tests/Mock/SomethingWasDone.php | 4 ++-- 36 files changed, 72 insertions(+), 72 deletions(-) diff --git a/LICENSE b/LICENSE index 75c03b7..4292a5a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ -Copyright (c) 2014-2017, prooph software GmbH -Copyright (c) 2015-2017, Sascha-Oliver Prolic +Copyright (c) 2014-2018, prooph software GmbH +Copyright (c) 2015-2018, Sascha-Oliver Prolic All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/Event/ActionEvent.php b/src/Event/ActionEvent.php index 3287b52..511d8a4 100644 --- a/src/Event/ActionEvent.php +++ b/src/Event/ActionEvent.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/ActionEventEmitter.php b/src/Event/ActionEventEmitter.php index 25de865..a1199a6 100644 --- a/src/Event/ActionEventEmitter.php +++ b/src/Event/ActionEventEmitter.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/ActionEventListenerAggregate.php b/src/Event/ActionEventListenerAggregate.php index 94606a1..676e58d 100644 --- a/src/Event/ActionEventListenerAggregate.php +++ b/src/Event/ActionEventListenerAggregate.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/DefaultActionEvent.php b/src/Event/DefaultActionEvent.php index 031fa23..1933528 100644 --- a/src/Event/DefaultActionEvent.php +++ b/src/Event/DefaultActionEvent.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/DefaultListenerHandler.php b/src/Event/DefaultListenerHandler.php index a6138b2..9b421bd 100644 --- a/src/Event/DefaultListenerHandler.php +++ b/src/Event/DefaultListenerHandler.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/DetachAggregateHandlers.php b/src/Event/DetachAggregateHandlers.php index 87edb79..fb351ae 100644 --- a/src/Event/DetachAggregateHandlers.php +++ b/src/Event/DetachAggregateHandlers.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/ListenerHandler.php b/src/Event/ListenerHandler.php index 82f0ca9..cfc2d60 100644 --- a/src/Event/ListenerHandler.php +++ b/src/Event/ListenerHandler.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/ProophActionEventEmitter.php b/src/Event/ProophActionEventEmitter.php index a35da56..b7c7bf4 100644 --- a/src/Event/ProophActionEventEmitter.php +++ b/src/Event/ProophActionEventEmitter.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/Command.php b/src/Messaging/Command.php index f9fd873..46f7416 100644 --- a/src/Messaging/Command.php +++ b/src/Messaging/Command.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/DomainEvent.php b/src/Messaging/DomainEvent.php index 6db9e8a..63a2244 100644 --- a/src/Messaging/DomainEvent.php +++ b/src/Messaging/DomainEvent.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/DomainMessage.php b/src/Messaging/DomainMessage.php index bb0c301..16c79ca 100644 --- a/src/Messaging/DomainMessage.php +++ b/src/Messaging/DomainMessage.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/FQCNMessageFactory.php b/src/Messaging/FQCNMessageFactory.php index 17375b0..48793b8 100644 --- a/src/Messaging/FQCNMessageFactory.php +++ b/src/Messaging/FQCNMessageFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/HasMessageName.php b/src/Messaging/HasMessageName.php index b7a6a95..97c8547 100644 --- a/src/Messaging/HasMessageName.php +++ b/src/Messaging/HasMessageName.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/Message.php b/src/Messaging/Message.php index 6c2dc4d..275edf7 100644 --- a/src/Messaging/Message.php +++ b/src/Messaging/Message.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/MessageConverter.php b/src/Messaging/MessageConverter.php index fc8342f..225b52f 100644 --- a/src/Messaging/MessageConverter.php +++ b/src/Messaging/MessageConverter.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/MessageDataAssertion.php b/src/Messaging/MessageDataAssertion.php index 93d4512..f3b3f19 100644 --- a/src/Messaging/MessageDataAssertion.php +++ b/src/Messaging/MessageDataAssertion.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/MessageFactory.php b/src/Messaging/MessageFactory.php index edbc955..f47ecef 100644 --- a/src/Messaging/MessageFactory.php +++ b/src/Messaging/MessageFactory.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/NoOpMessageConverter.php b/src/Messaging/NoOpMessageConverter.php index 70e592b..6ee21d4 100644 --- a/src/Messaging/NoOpMessageConverter.php +++ b/src/Messaging/NoOpMessageConverter.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/PayloadConstructable.php b/src/Messaging/PayloadConstructable.php index dcb50d4..16ec9b5 100644 --- a/src/Messaging/PayloadConstructable.php +++ b/src/Messaging/PayloadConstructable.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/PayloadTrait.php b/src/Messaging/PayloadTrait.php index bc2bb2b..0050eaf 100644 --- a/src/Messaging/PayloadTrait.php +++ b/src/Messaging/PayloadTrait.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/Query.php b/src/Messaging/Query.php index 3a08b04..6d1b5c5 100644 --- a/src/Messaging/Query.php +++ b/src/Messaging/Query.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/DefaultActionEventTest.php b/tests/Event/DefaultActionEventTest.php index 7caf353..2df389b 100644 --- a/tests/Event/DefaultActionEventTest.php +++ b/tests/Event/DefaultActionEventTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Event/ProophActionEventEmitterTest.php b/tests/Event/ProophActionEventEmitterTest.php index fa9409d..cd808d4 100644 --- a/tests/Event/ProophActionEventEmitterTest.php +++ b/tests/Event/ProophActionEventEmitterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/CommandTest.php b/tests/Messaging/CommandTest.php index 630cfca..1b246a8 100644 --- a/tests/Messaging/CommandTest.php +++ b/tests/Messaging/CommandTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/DomainEventTest.php b/tests/Messaging/DomainEventTest.php index c3ef8ec..31668d6 100644 --- a/tests/Messaging/DomainEventTest.php +++ b/tests/Messaging/DomainEventTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/FQCNMessageFactoryTest.php b/tests/Messaging/FQCNMessageFactoryTest.php index e1dbde5..8f2615d 100644 --- a/tests/Messaging/FQCNMessageFactoryTest.php +++ b/tests/Messaging/FQCNMessageFactoryTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/MessageDataAssertionTest.php b/tests/Messaging/MessageDataAssertionTest.php index e35ddfb..0d5051f 100644 --- a/tests/Messaging/MessageDataAssertionTest.php +++ b/tests/Messaging/MessageDataAssertionTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/NoOpMessageConverterTest.php b/tests/Messaging/NoOpMessageConverterTest.php index f41b7e5..93a66a2 100644 --- a/tests/Messaging/NoOpMessageConverterTest.php +++ b/tests/Messaging/NoOpMessageConverterTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/Messaging/QueryTest.php b/tests/Messaging/QueryTest.php index 9bc599a..e3c64b1 100644 --- a/tests/Messaging/QueryTest.php +++ b/tests/Messaging/QueryTest.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/ActionEventListenerMock.php b/tests/Mock/ActionEventListenerMock.php index 0a6c668..e585a33 100644 --- a/tests/Mock/ActionEventListenerMock.php +++ b/tests/Mock/ActionEventListenerMock.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/ActionListenerAggregateMock.php b/tests/Mock/ActionListenerAggregateMock.php index 3575afe..3dad335 100644 --- a/tests/Mock/ActionListenerAggregateMock.php +++ b/tests/Mock/ActionListenerAggregateMock.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/AskSomething.php b/tests/Mock/AskSomething.php index 0776af0..970e038 100644 --- a/tests/Mock/AskSomething.php +++ b/tests/Mock/AskSomething.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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 8b71421..b48df39 100644 --- a/tests/Mock/DoSomething.php +++ b/tests/Mock/DoSomething.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/InvalidMessage.php b/tests/Mock/InvalidMessage.php index 5eebf85..6e13511 100644 --- a/tests/Mock/InvalidMessage.php +++ b/tests/Mock/InvalidMessage.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 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/SomethingWasDone.php b/tests/Mock/SomethingWasDone.php index 731a846..6476910 100644 --- a/tests/Mock/SomethingWasDone.php +++ b/tests/Mock/SomethingWasDone.php @@ -1,8 +1,8 @@ - * (c) 2015-2017 Sascha-Oliver Prolic + * (c) 2014-2018 prooph software GmbH + * (c) 2015-2018 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code.