Test Setup Failed
Push — dev ( b27119...389162 )
by Herberto
04:46
created

OauthRefreshToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isRevoked() 0 4 1
A revoke() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Acme\App\Infrastructure\Auth\Authentication\Oauth;
6
7
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
8
use League\OAuth2\Server\Entities\Traits\EntityTrait;
9
use League\OAuth2\Server\Entities\Traits\RefreshTokenTrait;
10
11
/**
12
 * Class OauthRefreshToken
13
 *
14
 * @method OauthAccessToken getAccessToken()
15
 */
16
class OauthRefreshToken implements RefreshTokenEntityInterface
17
{
18
    use EntityTrait;
19
    use RefreshTokenTrait;
20
21
    /**
22
     * @var bool
23
     */
24
    private $revoked = false;
25
26
    public function __construct()
27
    {
28
        $this->setIdentifier(new OauthRefreshTokenId());
29
    }
30
31
    public function isRevoked(): bool
32
    {
33
        return $this->revoked;
34
    }
35
36
    public function revoke(): void
37
    {
38
        $this->revoked = true;
39
    }
40
}
41