final protected function raise(DomainEvent $event) : void
    {
        $this->setStateHash($this->calculateNextStateHash($event));
        if ($event instanceof AbstractDomainEvent) {
            AbstractDomainEvent::initEvent($event, $this->getId(), $this->stateHash());
        }
        EventPublisher::instance()->post($event);
    }
final protected function raise(DomainEvent $event) : void
    {
        $this->setStateHash($this->calculateNextStateHash($event));
        if ($event instanceof AbstractDomainEvent) {
            AbstractDomainEvent::initEvent($event, $this->getId(), $this->stateHash());
        }
        EventPublisher::instance()->post($event);
    }
final protected function raise ( DomainEvent $ event ) : void { $ this -> setStateHash ( $ this -> calculateNextStateHash ( $ event ) ) ; if ( $ event instanceof AbstractDomainEvent ) { AbstractDomainEvent :: initEvent ( $ event , $ this -> getId ( ) , $ this -> stateHash ( ) ) ; } EventPublisher :: instance ( ) -> post ( $ event ) ; }
Updates the state hash and sends the DomainEvent to the EventPublisher.
It also automatically fills the raised event if it extends AbstractDomainEvent.

@param DomainEvent $event
Updates the state hash and sends the DomainEvent to the EventPublisher . It also automatically fills the raised event if it extends AbstractDomainEvent .