Completed
Push — develop ( 5a11da...78fd78 )
by Raphael De
02:33
created

AccessToken::getHash()   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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
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
use Majora\Component\OAuth\Model\TokenInterface;
10
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
11
12
/**
13
 * Access token class.
14
 */
15
class AccessToken extends AbstractToken implements AccessTokenInterface
16
{
17
    /**
18
     * @var RefreshTokenInterface
19
     */
20
    protected $refreshToken;
21
22
    /**
23
     * @see AccessTokenInterface::__construct()
24
     */
25
    public function __construct(
26
        ApplicationInterface $application,
27
        AccountInterface $account = null,
28
        $expireIn = AccessTokenInterface::DEFAULT_TTL,
29
        $hash = null,
30
        RefreshTokenInterface $refreshToken = null
31
    ) {
32
        parent::__construct($application, $account, $expireIn, $hash);
33
        $this->refreshToken = $refreshToken;
34
    }
35
36
    /**
37
     * @see AccessTokenInterface::getRefreshToken()
38
     */
39
    public function getRefreshToken()
40
    {
41
        return $this->refreshToken;
42
    }
43
44
45
}
46