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

AccessToken::getJwt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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