BasicPolicyProvider::getPolicies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 4
dl 0
loc 8
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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