In my Bundle I use a SessionHandler service under FooBundle/Service/SessionHandler.php
This gets passed a customized Router which extends the Symfony Router:
use FooBundle/Routing/Router
(...)
public function __construct(HttpUtils $httpUtils, array $options, Router $router) {
$this->router = $router;
$this->container = $router->getContainer();
$this->defaultLogoutHandler = new DefaultLogoutSuccessHandler($httpUtils);
parent::__construct($httpUtils, $options);
}
This did work back in Symfony 2.1
With 3.1 I get an Exception:
Catchable Fatal Error: Argument 3 passed to FooBundle\Service\SessionHandler::__construct() must be an instance of FooBundle\Routing\Router, instance of Symfony\Bundle\FrameworkBundle\Routing\Router given
Here is what my services.xml looks like:
<!-- SessionHandler -->
<service id="foo.sessionhandler" class="FooBundle\Service\SessionHandler">
<argument type="service" id="security.http_utils" />
<argument type="collection" id="options" />
<argument type="service" id="router" />
</service>
So how do I get this service to use my customized router?