AuthorizationCode::getClientId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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