private function mutate($event)
    {
        $method = 'on' . (string) new EventName($event);

        if (method_exists($this, $method)) {
            $this->$method($event);
        } else {
            throw new \RuntimeException(sprintf('Method %s does not exist on aggregate %s', $method, get_class($this)));
        }
    }
private function mutate($event)
    {
        $method = 'on' . (string) new EventName($event);

        if (method_exists($this, $method)) {
            $this->$method($event);
        } else {
            throw new \RuntimeException(sprintf('Method %s does not exist on aggregate %s', $method, get_class($this)));
        }
    }
private function mutate ( $ event ) { $ method = 'on' . ( string ) new EventName ( $ event ) ; if ( method_exists ( $ this , $ method ) ) { $ this -> $ method ( $ event ) ; } else { throw new \ RuntimeException ( sprintf ( 'Method %s does not exist on aggregate %s' , $ method , get_class ( $ this ) ) ) ; } }
Update in-memory state.

@param object $event
Update in - memory state .