Failed Conditions
Push — master ( c6baf0...a3629e )
by Florent
16:19
created

CreateAccessToken   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 56
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getAccessTokenId() 0 4 1
A getResourceOwnerId() 0 4 1
A getClientId() 0 4 1
A getParameter() 0 4 1
A getMetadata() 0 4 1
A getExpiresAt() 0 4 1
A getResourceServerId() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\Component\Core\AccessToken\Command;
15
16
use OAuth2Framework\Component\Core\AccessToken\AccessTokenId;
17
use OAuth2Framework\Component\Core\Client\ClientId;
18
use OAuth2Framework\Component\Core\DataBag\DataBag;
19
use OAuth2Framework\Component\Core\ResourceOwner\ResourceOwnerId;
20
use OAuth2Framework\Component\Core\ResourceServer\ResourceServerId;
21
22
class CreateAccessToken
23
{
24
    private $accessTokenId;
25
    private $resourceOwnerId;
26
    private $clientId;
27
    private $parameter;
28
    private $metadata;
29
    private $expiresAt;
30
    private $resourceServerId;
31
32
    public function __construct(AccessTokenId $accessTokenId, ResourceOwnerId $resourceOwnerId, ClientId $clientId, DataBag $parameter, DataBag $metadata, \DateTimeImmutable $expiresAt, ?ResourceServerId $resourceServerId)
33
    {
34
        $this->accessTokenId = $accessTokenId;
35
        $this->resourceOwnerId = $resourceOwnerId;
36
        $this->clientId = $clientId;
37
        $this->parameter = $parameter;
38
        $this->metadata = $metadata;
39
        $this->expiresAt = $expiresAt;
40
        $this->resourceServerId = $resourceServerId;
41
    }
42
43
    public function getAccessTokenId(): AccessTokenId
44
    {
45
        return $this->accessTokenId;
46
    }
47
48
    public function getResourceOwnerId(): ResourceOwnerId
49
    {
50
        return $this->resourceOwnerId;
51
    }
52
53
    public function getClientId(): ClientId
54
    {
55
        return $this->clientId;
56
    }
57
58
    public function getParameter(): DataBag
59
    {
60
        return $this->parameter;
61
    }
62
63
    public function getMetadata(): DataBag
64
    {
65
        return $this->metadata;
66
    }
67
68
    public function getExpiresAt(): \DateTimeImmutable
69
    {
70
        return $this->expiresAt;
71
    }
72
73
    public function getResourceServerId(): ?ResourceServerId
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
74
    {
75
        return $this->resourceServerId;
76
    }
77
}
78