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

LaminasAclService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isAllowed() 0 3 1
A __construct() 0 3 1
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