Skip to content
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
2 changes: 1 addition & 1 deletion src/ActionEventEmitterEventStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use Prooph\EventStore\Projection\ReadModelProjectionFactory;
use Prooph\EventStore\Util\Assertion;

class ActionEventEmitterEventStore implements EventStore
class ActionEventEmitterEventStore implements EventStore, EventStoreDecorator
{
public const EVENT_APPEND_TO = 'appendTo';
public const EVENT_CREATE = 'create';
Expand Down
18 changes: 18 additions & 0 deletions src/EventStoreDecorator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* This file is part of the prooph/event-store.
* (c) 2014-2017 prooph software GmbH <contact@prooph.de>
* (c) 2015-2017 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.
*/

declare(strict_types=1);

namespace Prooph\EventStore;

interface EventStoreDecorator
{
public function getInnerEventStore(): EventStore;
}
4 changes: 2 additions & 2 deletions src/Projection/InMemoryEventStoreProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use Closure;
use Iterator;
use Prooph\Common\Messaging\Message;
use Prooph\EventStore\ActionEventEmitterEventStore;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\EventStoreDecorator;
use Prooph\EventStore\Exception;
use Prooph\EventStore\InMemoryEventStore;
use Prooph\EventStore\Stream;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function __construct(EventStore $eventStore, string $name, int $cacheSize
$this->cachedStreamNames = new ArrayCache($cacheSize);
$this->sleep = $sleep;

if ($eventStore instanceof ActionEventEmitterEventStore) {
while ($eventStore instanceof EventStoreDecorator) {
$eventStore = $eventStore->getInnerEventStore();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Projection/InMemoryEventStoreQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use Closure;
use Iterator;
use Prooph\Common\Messaging\Message;
use Prooph\EventStore\ActionEventEmitterEventStore;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\EventStoreDecorator;
use Prooph\EventStore\Exception;
use Prooph\EventStore\InMemoryEventStore;
use Prooph\EventStore\StreamName;
Expand Down Expand Up @@ -72,7 +72,7 @@ public function __construct(EventStore $eventStore)
{
$this->eventStore = $eventStore;

if ($eventStore instanceof ActionEventEmitterEventStore) {
while ($eventStore instanceof EventStoreDecorator) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!!!

$eventStore = $eventStore->getInnerEventStore();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Projection/InMemoryEventStoreReadModelProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use Closure;
use Iterator;
use Prooph\Common\Messaging\Message;
use Prooph\EventStore\ActionEventEmitterEventStore;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\EventStoreDecorator;
use Prooph\EventStore\Exception;
use Prooph\EventStore\InMemoryEventStore;
use Prooph\EventStore\StreamName;
Expand Down Expand Up @@ -118,7 +118,7 @@ public function __construct(
$this->readModel = $readModel;
$this->sleep = $sleep;

if ($eventStore instanceof ActionEventEmitterEventStore) {
while ($eventStore instanceof EventStoreDecorator) {
$eventStore = $eventStore->getInnerEventStore();
}

Expand Down