Completed
Push — orm ( df18d5...6592b1 )
by
unknown
02:37
created

AccessToken   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 1
dl 0
loc 29
ccs 0
cts 14
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getRefreshToken() 0 4 1
1
<?php
2
3
namespace Majora\Component\OAuth\Entity;
4
5
use Majora\Component\OAuth\Model\AccessTokenInterface;
6
use Majora\Component\OAuth\Model\AccountInterface;
7
use Majora\Component\OAuth\Model\ApplicationInterface;
8
use Majora\Component\OAuth\Model\RefreshTokenInterface;
9
10
11
/**
12
 * Access token class.
13
 */
14
class AccessToken extends Token implements AccessTokenInterface
15
{
16
    /**
17
     * @var RefreshTokenInterface
18
     */
19
    protected $refreshToken;
20
21
    /**
22
     * @see AccessTokenInterface::__construct()
23
     */
24
    public function __construct(
25
        ApplicationInterface $application,
26
        AccountInterface $account = null,
27
        $expireIn = AccessTokenInterface::DEFAULT_TTL,
28
        $hash = null,
29
        RefreshTokenInterface $refreshToken = null
30
    ) {
31
        parent::__construct($application, $account, $expireIn, $hash);
32
        $this->refreshToken = $refreshToken;
33
    }
34
35
    /**
36
     * @see AccessTokenInterface::getRefreshToken()
37
     */
38
    public function getRefreshToken()
39
    {
40
        return $this->refreshToken;
41
    }
42
}
43