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

AccessToken::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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