Completed
Pull Request — master (#20)
by Дмитрий
09:49 queued 07:44
created

AccessToken   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 36
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getJwt() 0 4 1
A setJwt() 0 4 1
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
7
namespace SocialConnect\OpenIDConnect;
8
9
use SocialConnect\Provider\Exception\InvalidAccessToken;
10
11
class AccessToken extends \SocialConnect\OAuth2\AccessToken
12
{
13
    /**
14
     * @var JWT
15
     */
16
    protected $jwt;
17
18
    /**
19
     * @param array $token
20
     * @throws InvalidAccessToken
21
     */
22
    public function __construct(array $token)
23
    {
24
        parent::__construct($token);
25
26
        if (!isset($token['id_token'])) {
27
            throw new InvalidAccessToken('id_token doesnot exists inside AccessToken');
28
        }
29
    }
30
31
    /**
32
     * @return JWT
33
     */
34
    public function getJwt()
35
    {
36
        return $this->jwt;
37
    }
38
39
    /**
40
     * @param JWT $jwt
41
     */
42
    public function setJwt($jwt)
43
    {
44
        $this->jwt = $jwt;
45
    }
46
}
47