RefreshToken::getScope()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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