original_string: protected function apply(DomainEvent $event): void {
          $eventName = explode('\\', get_class($event));
  
          $method = 'apply' . $eventName[count($eventName) - 1];
  
          if (method_exists($this, $method)) {
              $this->$method($event);
          }
  
          $this->version = $this->version->next();
      }
code: protected function apply(DomainEvent $event): void {
          $eventName = explode('\\', get_class($event));
  
          $method = 'apply' . $eventName[count($eventName) - 1];
  
          if (method_exists($this, $method)) {
              $this->$method($event);
          }
  
          $this->version = $this->version->next();
      }
code_tokens: protected function apply ( DomainEvent $ event ) : void { $ eventName = explode ( '\\' , get_class ( $ event ) ) ; $ method = 'apply' . $ eventName [ count ( $ eventName ) - 1 ] ; if ( method_exists ( $ this , $ method ) ) { $ this -> $ method ( $ event ) ; } $ this -> version = $ this -> version -> next ( ) ; }
docstring: apply domain events to aggregate state by mapping the class
  name to method name using strings
  
  @param DomainEvent $event
docstring_tokens: apply domain events to aggregate state by mapping the class name to method name using strings