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

Fix DomainMessage metadata bottleneck #69

Merged
merged 2 commits into from
Mar 22, 2018
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
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Event/ActionEvent.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/ActionEventEmitter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/ActionEventListenerAggregate.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/DefaultActionEvent.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/DefaultListenerHandler.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/DetachAggregateHandlers.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/ListenerHandler.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Event/ProophActionEventEmitter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/Command.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/DomainEvent.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
16 changes: 8 additions & 8 deletions src/Messaging/DomainMessage.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -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;
}

/**
Expand All @@ -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;
}
}
4 changes: 2 additions & 2 deletions src/Messaging/FQCNMessageFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/HasMessageName.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/Message.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/MessageConverter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/MessageDataAssertion.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/MessageFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/NoOpMessageConverter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/PayloadConstructable.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/PayloadTrait.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/Query.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Event/DefaultActionEventTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Event/ProophActionEventEmitterTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/CommandTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/DomainEventTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/FQCNMessageFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/MessageDataAssertionTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/NoOpMessageConverterTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/QueryTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Mock/ActionEventListenerMock.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Mock/ActionListenerAggregateMock.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Mock/AskSomething.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
4 changes: 2 additions & 2 deletions tests/Mock/DoSomething.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* This file is part of the prooph/common.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* (c) 2014-2018 prooph software GmbH <contact@prooph.de>
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
Loading