Passed
Push — master ( 8c9dd9...52f75f )
by Mr
02:31
created

LaminasAclService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/security-interop project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Security\Authorization;
10
11
use Laminas\Permissions\Acl\AclInterface;
12
use Laminas\Permissions\Acl\Resource\ResourceInterface;
13
use Laminas\Permissions\Acl\Role\RoleInterface;
14
15
final class LaminasAclService implements AuthorizationServiceInterface
16
{
17
    private AclInterface $acl;
18
19
    public function __construct(AclInterface $acl)
20
    {
21
        $this->acl = $acl;
22
    }
23
24
    /**
25
     * @param null|RoleInterface $role
26
     * @param null|ResourceInterface $resource
27
     * @param null|string $privilege
28
     */
29
    public function isAllowed($role = null, $resource = null, $privilege = null): bool
30
    {
31
        return $this->acl->isAllowed($role, $resource, $privilege);
32
    }
33
}
34