/** * @param ActionInterface $action action * @param string $type type * @param mixed $component component * @throws \Exception */ public function addComponent($action, $type, $component) { if (!$component instanceof ComponentInterface && !is_scalar($component)) { $component = $this->findOrCreateComponent($component); if (null === $component) { throw new \Exception(sprintf('Impossible to create component from %s.', $type)); } } $action->addComponent($type, $component, $this->actionComponentClass); }