Completed
Push — master ( fec6f1...fc6f01 )
by Alexandre
03:31
created

AuthorizationRequest::getCodeChallengeMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 11/06/2018
6
 * Time: 21:05
7
 */
8
9
namespace OAuth2\Extensions\PKCE\Endpoints\Authorization;
10
11
12
class AuthorizationRequest extends \OAuth2\Endpoints\Authorization\AuthorizationRequest
13
{
14
    /**
15
     * @var string
16
     */
17
    private $codeChallenge;
18
    /**
19
     * @var string
20
     */
21
    private $codeChallengeMethod;
22
23
    public function __construct(\OAuth2\Endpoints\Authorization\AuthorizationRequest $authorizationRequest,
24
                                string $codeChallenge, string $codeChallengeMethod = 'plain')
25
    {
26
        parent::__construct($authorizationRequest->getData(),
27
            $authorizationRequest->getResourceOwner(),
28
            $authorizationRequest->getClient(),
29
            $authorizationRequest->getRedirectUri(),
30
            $authorizationRequest->getResponseType(),
31
            $authorizationRequest->getResponseMode(),
32
            $authorizationRequest->getScopes(),
33
            $authorizationRequest->getRequestedScopes(),
34
            $authorizationRequest->getState());
35
36
        $this->codeChallenge = $codeChallenge;
37
        $this->codeChallengeMethod = $codeChallengeMethod;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getCodeChallenge(): string
44
    {
45
        return $this->codeChallenge;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getCodeChallengeMethod(): string
52
    {
53
        return $this->codeChallengeMethod;
54
    }
55
}