src/Domain/EventSourcedAggregateRoot.php
/**
     * Apply Domain event
     *
     * @param DomainEvent $domainEvent
     */
Apply Domain event
@param DomainEvent $domainEvent
Apply Domain event @param DomainEvent $domainEvent
protected function apply(DomainEvent $domainEvent): void
    {
        $methodName = $this->when($domainEvent);
        if (method_exists($this, $methodName)) {
            $this->$methodName($domainEvent);
        }
        $this->version++;
    }
protected function apply ( DomainEvent $ domainEvent ) : void { $ methodName = $ this -> when ( $ domainEvent ) ; if ( method_exists ( $ this , $ methodName ) ) { $ this -> $ methodName ( $ domainEvent ) ; } $ this -> version ++ ; }
Apply Domain event
 @param DomainEvent $domainEvent
Apply Domain event @param DomainEvent $domainEvent