dispatcher not needed anymore in ActionFactory

This commit is contained in:
Manuel Raynaud
2013-05-22 09:23:13 +02:00
parent c6fb8f22f1
commit 7570e55ba8
2 changed files with 2 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ class ControllerListener implements EventSubscriberInterface
$request = $event->getRequest(); $request = $event->getRequest();
if (false !== $action = $request->get("action")) { if (false !== $action = $request->get("action")) {
//search corresponding action //search corresponding action
$event = new ActionEventFactory($request, $action, $event->getDispatcher(), $event->getKernel()->getContainer()->getParameter("thelia.actionEvent")); $event = new ActionEventFactory($request, $action, $event->getKernel()->getContainer()->getParameter("thelia.actionEvent"));
$dispatcher->dispatch("action.".$action, $event->createActionEvent()); $dispatcher->dispatch("action.".$action, $event->createActionEvent());
} }

View File

@@ -32,7 +32,6 @@ class ActionEventFactory
protected $request; protected $request;
protected $action; protected $action;
protected $dispatcher;
/** /**
* @todo : delegate to config for creating associating value * @todo : delegate to config for creating associating value
@@ -43,11 +42,10 @@ class ActionEventFactory
protected $defaultClassName = "Thelia\Core\Event\DefaultActionEvent"; protected $defaultClassName = "Thelia\Core\Event\DefaultActionEvent";
public function __construct(Request $request, $action, EventDispatcherInterface $dispatcher, $className) public function __construct(Request $request, $action, $className)
{ {
$this->request = $request; $this->request = $request;
$this->action = $action; $this->action = $action;
$this->dispatcher = $dispatcher;
$this->className = $className; $this->className = $className;
} }