| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class Authorizer extends BaseAuthorizer |
||
| 20 | { |
||
| 21 | private $manager; |
||
| 22 | |||
| 23 | 43 | public function __construct(Manager $manager) |
|
| 24 | { |
||
| 25 | 43 | $this->manager = $manager; |
|
| 26 | 43 | } |
|
| 27 | |||
| 28 | 25 | public function canAny(PermissionsOwner $owner, array $permissions): bool |
|
| 29 | { |
||
| 30 | 25 | return $this->manager->permissions($owner)->contains($this->any($permissions)); |
|
| 31 | } |
||
| 32 | |||
| 33 | 16 | public function isAny(RolesOwner $owner, array $roles): bool |
|
| 36 | } |
||
| 37 | |||
| 38 | 41 | private function any(array $authorizations): Closure |
|
| 42 | 41 | }; |
|
| 43 | } |
||
| 45 |