Passed
Push — master ( e88490...575397 )
by Alexandre
04:15
created

AuthorizationCode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getIdToken() 0 3 1
A setIdToken() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 17/03/2018
6
 * Time: 13:50
7
 */
8
9
namespace OAuth2\Extensions\OpenID\Credentials;
10
11
12
class AuthorizationCode extends \OAuth2\Credentials\AuthorizationCode implements AuthorizationCodeInterface
13
{
14
15
    /**
16
     * @var string|null
17
     */
18
    protected $idToken;
19
20
    public function __construct(string $code, string $scope, string $clientIdentifier, string $resourceOwnerIdentifier,
21
                                int $expiresAt, ?string $requestedScope = null, ?string $redirectUri = null,
22
                                ?string $idToken = null)
23
    {
24
        parent::__construct($code, $scope, $clientIdentifier, $resourceOwnerIdentifier,
25
            $expiresAt, $requestedScope, $redirectUri);
26
        $this->idToken = $idToken;
27
    }
28
29
    public function getIdToken(): ?string
30
    {
31
        return $this->idToken;
32
    }
33
34
    /**
35
     * @param null|string $idToken
36
     */
37
    public function setIdToken(?string $idToken): void
38
    {
39
        $this->idToken = $idToken;
40
    }
41
}