Conditions | 3 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
21 | 5 | public function matchesResource(AuthorizationEntityInterface $resource): bool |
|
22 | { |
||
23 | 5 | if ($this->resourceMatcher === '*') { |
|
24 | 1 | return true; |
|
25 | 4 | } elseif (substr($this->resourceMatcher, -3, 3) === '::*') { |
|
26 | 2 | return $resource->getType() === substr($this->resourceMatcher, 0, -3); |
|
27 | } |
||
28 | 2 | return ($resource->getType() . '::' . $resource->getId()) === $this->resourceMatcher; |
|
29 | } |
||
43 |