AuthorizationRequest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 29
ccs 10
cts 10
cp 1
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getContext() 0 3 1
A __construct() 0 7 1
A getResource() 0 3 1
A getAction() 0 3 1
A getSubject() 0 3 1
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