AuthorizationRequest::getResource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace jschreuder\MiddleAuth\Basic;
4
5
use jschreuder\MiddleAuth\AuthorizationRequestInterface;
6
use jschreuder\MiddleAuth\AuthorizationEntityInterface;
7
8
final class AuthorizationRequest implements AuthorizationRequestInterface
9
{
10 13
    public function __construct(
11
        private AuthorizationEntityInterface $subject,
12
        private AuthorizationEntityInterface $resource,
13
        private string $action,
14
        private array $context
15
    )
16
    {
17 13
    }
18
19 9
    public function getSubject(): AuthorizationEntityInterface
20
    {
21 9
        return $this->subject;
22
    }
23
24 9
    public function getResource(): AuthorizationEntityInterface
25
    {
26 9
        return $this->resource;
27
    }
28
29 9
    public function getAction(): string
30
    {
31 9
        return $this->action;
32
    }
33
34 3
    public function getContext(): array
35
    {
36 3
        return $this->context;
37
    }
38
}
39