With Symfony >= 2.8, you have the AutowirePass that makes a simplification in service definition.
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Http\HttpUtils;
class AuthenticationSuccessHandler extends DefaultAuthenticationSuccessHandler
{
/**
* @var Router
*/
protected $router;
public function __construct(HttpUtils $httpUtils, array $options = [], Router $router)
{
parent::__construct($httpUtils, $options);
$this->router = $router;
}
Note that the default value "$options = []" is important for the AutowirePass : without that, an exception will be thrown. But you have an empty array.
into services.yml:
my_auth_success_handler:
class: Me\MyBundle\Handler\AuthenticationSuccessHandler
public: false
autowire: true
No need to specify arguments here ;-)