for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Domain\Eventing;
use Domain\Identity\Identity;
use Domain\Eventing\Exception\CorruptAggregateHistory;
/**
* @author Sebastiaan Hilbers <[email protected]>
*/
class UncommittedEvents extends AbstractEventStream
{
public function __construct(Identity $identity)
$this->identity = $identity;
}
public function append(DomainEvent $event)
if ($event->getAggregateIdentity() !== $this->identity) {
throw new CorruptAggregateHistory('Event Identity is not matching the eventstreams\'s identity');
$this->events[] = $event;