BasicPolicyProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getPolicies() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace jschreuder\MiddleAuth\Abac;
4
5
use jschreuder\MiddleAuth\AuthorizationEntityInterface;
6
7
final class BasicPolicyProvider implements PolicyProviderInterface
8
{
9
    private PoliciesCollection $policies;
10
11 4
    public function __construct(PolicyInterface ...$policies)
12
    {
13 4
        $this->policies = new PoliciesCollection(...$policies);
14
    }
15
16 4
    public function getPolicies(
17
        AuthorizationEntityInterface $actor,
18
        AuthorizationEntityInterface $resource,
19
        string $action,
20
        array $context
21
    ): PoliciesCollection
22
    {
23 4
        return $this->policies;
24
    }
25
}
26