AuthorizationCode   A
last analyzed

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
0 ignored issues
show
Deprecated Code introduced by
The interface OAuth2\Extensions\OpenID...horizationCodeInterface has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

12
class AuthorizationCode extends \OAuth2\Credentials\AuthorizationCode implements /** @scrutinizer ignore-deprecated */ AuthorizationCodeInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
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
                                \DateTimeInterface $expiresAt, ?string $requestedScope = null, ?string $redirectUri = null,
22
                                ?string $idToken = null)
23
    {
24
        parent::__construct($code, $scope, $clientIdentifier, $resourceOwnerIdentifier,
0 ignored issues
show
Bug introduced by
$scope of type string is incompatible with the type array expected by parameter $scopes of OAuth2\Credentials\Autho...tionCode::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
        parent::__construct($code, /** @scrutinizer ignore-type */ $scope, $clientIdentifier, $resourceOwnerIdentifier,
Loading history...
25
            $expiresAt, $requestedScope, $redirectUri);
0 ignored issues
show
Bug introduced by
It seems like $requestedScope can also be of type string; however, parameter $requestedScopes of OAuth2\Credentials\Autho...tionCode::__construct() does only seem to accept null|array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
            $expiresAt, /** @scrutinizer ignore-type */ $requestedScope, $redirectUri);
Loading history...
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
}