RefreshToken   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 6
eloc 6
dl 0
loc 42
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getClientId() 0 3 1
A __construct() 0 8 1
A getUserId() 0 3 1
A getExpires() 0 3 1
A getScope() 0 3 1
A getRefreshToken() 0 3 1
1
<?php
2
3
namespace kalanis\OAuth2\Storage\RefreshTokens;
4
5
6
use DateTime;
7
8
9
/**
10
 * RefreshToken
11
 * @package kalanis\OAuth2\Storage\RefreshTokens
12
 */
13 1
class RefreshToken implements IRefreshToken
14
{
15
    /**
16
     * @param string $refreshToken
17
     * @param DateTime $expires
18
     * @param string|int $clientId
19
     * @param string|int|null $userId
20
     * @param array<string> $scope
21
     */
22 1
    public function __construct(
23
        private readonly string $refreshToken,
24
        private readonly DateTime $expires,
25
        private readonly string|int $clientId,
26
        private readonly string|int|null $userId,
27
        private readonly array $scope = [],
28
    )
29
    {
30 1
    }
31
32
    public function getRefreshToken(): string
33
    {
34 1
        return $this->refreshToken;
35
    }
36
37
    public function getExpires(): DateTime
38
    {
39 1
        return $this->expires;
40
    }
41
42
    public function getClientId(): string|int
43
    {
44 1
        return $this->clientId;
45
    }
46
47
    public function getUserId(): string|int|null
48
    {
49 1
        return $this->userId;
50
    }
51
52
    public function getScope(): array
53
    {
54
        return $this->scope;
55
    }
56
}
57