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;
    }
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;
    }
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 ; }
Add an executor.

@param ExecutorInterface $executor

@throws \InvalidArgumentException
Add an executor .