Passed
Push — master ( fd01cd...a8d522 )
by Alexandre
02:26
created

AuthorizationCode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getCodeChallengeMethod() 0 3 1
A setCodeChallenge() 0 3 1
A __construct() 0 7 1
A setCodeChallengeMethod() 0 3 1
A getCodeChallenge() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 07/03/2018
6
 * Time: 21:57
7
 */
8
9
namespace OAuth2\Extensions\PKCE\Credentials;
10
11
12
class AuthorizationCode extends \OAuth2\Credentials\AuthorizationCode
13
{
14
    /**
15
     * @var string|null
16
     */
17
    protected $codeChallenge;
18
    /**
19
     * @var string|null
20
     */
21
    protected $codeChallengeMethod;
22
23
    public function __construct(string $code, string $scope, string $clientIdentifier, string $resourceOwnerIdentifier,
24
                                int $expiresAt, ?string $requestedScope = null, ?string $redirectUri = null,
25
                                ?string $codeChallenge = null, ?string $codeChallengeMethod = null)
26
    {
27
       parent::__construct($code, $scope, $clientIdentifier, $resourceOwnerIdentifier, $expiresAt, $requestedScope, $redirectUri);
28
        $this->codeChallenge = $codeChallenge;
29
        $this->codeChallengeMethod = $codeChallengeMethod;
30
    }
31
32
    /**
33
     * @return null|string
34
     */
35
    public function getCodeChallenge(): ?string
36
    {
37
        return $this->codeChallenge;
38
    }
39
40
    /**
41
     * @param null|string $codeChallenge
42
     */
43
    public function setCodeChallenge(?string $codeChallenge): void
44
    {
45
        $this->codeChallenge = $codeChallenge;
46
    }
47
48
    /**
49
     * @return null|string
50
     */
51
    public function getCodeChallengeMethod(): ?string
52
    {
53
        return $this->codeChallengeMethod;
54
    }
55
56
    /**
57
     * @param null|string $codeChallengeMethod
58
     */
59
    public function setCodeChallengeMethod(?string $codeChallengeMethod): void
60
    {
61
        $this->codeChallengeMethod = $codeChallengeMethod;
62
    }
63
}