| Total Complexity | 5 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class All implements NamedAssertion |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var NamedAssertion[] |
||
| 15 | */ |
||
| 16 | private readonly array $asserts; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Check if all asserts are true. |
||
| 20 | */ |
||
| 21 | 8 | public function __construct(NamedAssertion ...$asserts) |
|
| 22 | { |
||
| 23 | 8 | $this->asserts = $asserts; |
|
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Assert that all given asserts are correct (AND logic). |
||
| 28 | * |
||
| 29 | * @param \Ecodev\Felix\Acl\Acl $acl |
||
| 30 | * @param ?string $privilege |
||
| 31 | */ |
||
| 32 | 7 | public function assert(Acl $acl, ?RoleInterface $role = null, ?ResourceInterface $resource = null, $privilege = null): bool |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | public function getName(): string |
|
| 46 | } |
||
| 47 | } |
||
| 48 |