AuthorizationResponse::isPermitted()   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\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