| 1 | <?php |
||
| 26 | abstract class BooleanRule implements RuleInterface |
||
| 27 | { |
||
| 28 | const BOOLEAN_AND = 'and'; |
||
| 29 | const BOOLEAN_OR = 'or'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * How to process results on sub rules. |
||
| 33 | */ |
||
| 34 | const JOINER = self::BOOLEAN_AND; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Rules repository. |
||
| 38 | * |
||
| 39 | * @var RulesInterface |
||
| 40 | */ |
||
| 41 | private $repository = null; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Rule rule names. |
||
| 45 | * |
||
| 46 | * @var array |
||
| 47 | */ |
||
| 48 | protected $rules = []; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param RulesInterface $repository |
||
| 52 | */ |
||
| 53 | public function __construct(RulesInterface $repository) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | */ |
||
| 61 | public function allows(ActorInterface $actor, string $permission, array $context): bool |
||
| 80 | } |