AuthorizationResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getReason() 0 3 1
A isPermitted() 0 3 1
A getHandler() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace jschreuder\MiddleAuth\Basic;
4
5
use jschreuder\MiddleAuth\AuthorizationResponseInterface;
6
7
final class AuthorizationResponse implements AuthorizationResponseInterface
8
{
9 20
    public function __construct(
10
        private bool $permitted,
11
        private ?string $reason = null,
12
        private ?string $handler = null
13
    )
14
    {
15 20
    }
16
17 16
    public function isPermitted(): bool
18
    {
19 16
        return $this->permitted;
20
    }
21
22 5
    public function getReason(): ?string
23
    {
24 5
        return $this->reason;
25
    }
26
27 2
    public function getHandler(): ?string
28
    {
29 2
        return $this->handler;
30
    }
31
}
32