Failed Conditions
Push — master ( 7c3864...930f9b )
by Florent
14:15
created

AuthorizationEndpointController::getUiLocale()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4555
c 0
b 0
f 0
cc 5
nc 4
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\ServerBundle\Controller;
15
16
use Http\Message\ResponseFactory;
17
use OAuth2Framework\Component\AuthorizationEndpoint\AuthorizationEndpoint;
18
use OAuth2Framework\Component\AuthorizationEndpoint\AuthorizationRequest\AuthorizationRequestLoader;
19
use OAuth2Framework\Component\AuthorizationEndpoint\Consent\ConsentRepository;
20
use OAuth2Framework\Component\AuthorizationEndpoint\ParameterChecker\ParameterCheckerManager;
21
use OAuth2Framework\Component\AuthorizationEndpoint\User\UserAuthenticationCheckerManager;
22
use OAuth2Framework\Component\AuthorizationEndpoint\User\UserDiscovery;
23
use Symfony\Component\HttpFoundation\Session\SessionInterface;
24
use Symfony\Component\Routing\RouterInterface;
25
26
final class AuthorizationEndpointController extends AuthorizationEndpoint
27
{
28
    private $router;
29
30
    public function __construct(ResponseFactory $responseFactory, AuthorizationRequestLoader $authorizationRequestLoader, ParameterCheckerManager $parameterCheckerManager, UserDiscovery $userManager, UserAuthenticationCheckerManager $userCheckerManager, SessionInterface $session, ?ConsentRepository $consentRepository, RouterInterface $router)
31
    {
32
        parent::__construct($responseFactory, $authorizationRequestLoader, $parameterCheckerManager, $userManager, $userCheckerManager, $session, $consentRepository);
33
        $this->router = $router;
34
    }
35
36
    protected function getRouteFor(string $action, string $authorizationId): string
37
    {
38
        return $this->router->generate($action, ['authorization_id' => $authorizationId]);
39
    }
40
}
41