Passed
Push — master ( 8278f2...2a258c )
by Alexandre
02:55
created

AuthenticatedRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 27/05/2018
6
 * Time: 17:48
7
 */
8
9
namespace OAuth2\Roles\ResourceServer;
10
11
12
use OAuth2\Roles\ClientTypes\RegisteredClientInterface;
13
use OAuth2\Roles\ResourceOwnerInterface;
14
use Psr\Http\Message\ServerRequestInterface;
15
16
class AuthenticatedRequest
17
{
18
    /**
19
     * @var ServerRequestInterface
20
     */
21
    private $request;
22
    /**
23
     * @var RegisteredClientInterface
24
     */
25
    private $client;
26
    /**
27
     * @var null|ResourceOwnerInterface
28
     */
29
    private $resourceOwner;
30
    /**
31
     * @var array
32
     */
33
    private $scopes;
34
35
    public function __construct(ServerRequestInterface $request,
36
                                RegisteredClientInterface $client,
37
                                ?ResourceOwnerInterface $resourceOwner,
38
                                array $scopes)
39
    {
40
        $this->request = $request;
41
        $this->client = $client;
42
        $this->resourceOwner = $resourceOwner;
43
        $this->scopes = $scopes;
44
    }
45
46
    /**
47
     * @return ServerRequestInterface
48
     */
49
    public function getRequest(): ServerRequestInterface
50
    {
51
        return $this->request;
52
    }
53
54
    /**
55
     * @return RegisteredClientInterface
56
     */
57
    public function getClient(): RegisteredClientInterface
58
    {
59
        return $this->client;
60
    }
61
62
    /**
63
     * @return null|ResourceOwnerInterface
64
     */
65
    public function getResourceOwner(): ?ResourceOwnerInterface
66
    {
67
        return $this->resourceOwner;
68
    }
69
70
    /**
71
     * @return array
72
     */
73
    public function getScopes(): array
74
    {
75
        return $this->scopes;
76
    }
77
}