/**
  * @param DomainEventInterface $event
  */
 protected function recordApplyAndPublishEvent(DomainEventInterface $event)
 {
     Validator::assert($event);
     $this->version()->increment(VersionIncrementType::PATCH());
     $event->setVersion($this->version()->patch());
     $this->recordEvent($event);
     $this->applyEvent($event);
     $this->publishEvent($event);
 }
Beispiel #2
0
 /**
  * @return Validator
  */
 public function createValidator()
 {
     return Validator::create();
 }
 /**
  * {@inheritdoc}
  */
 public function handle($message, callable $next)
 {
     Validator::assert($message);
     $next($message);
 }