AuthorizationCode   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
eloc 6
dl 0
loc 43
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

6 Methods

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