original_string: public function addExecutor(ExecutorInterface $executor)
      {
          $action = $executor->getName();
  
          if ($this->hasExecutor($action)) {
              throw new \InvalidArgumentException(sprintf(
                  'There is already an executor registered for action "%s".',
                  $action
              ));
          }
  
          $this->executors[$action] = $executor;
      }
code: public function addExecutor(ExecutorInterface $executor)
      {
          $action = $executor->getName();
  
          if ($this->hasExecutor($action)) {
              throw new \InvalidArgumentException(sprintf(
                  'There is already an executor registered for action "%s".',
                  $action
              ));
          }
  
          $this->executors[$action] = $executor;
      }
code_tokens: public function addExecutor ( ExecutorInterface $ executor ) { $ action = $ executor -> getName ( ) ; if ( $ this -> hasExecutor ( $ action ) ) { throw new \ InvalidArgumentException ( sprintf ( 'There is already an executor registered for action "%s".' , $ action ) ) ; } $ this -> executors [ $ action ] = $ executor ; }
docstring: Add an executor.
  
  @param ExecutorInterface $executor
  
  @throws \InvalidArgumentException
docstring_tokens: Add an executor .