| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 11 | #[Package('business-ops')] |
||
| 12 | class OrderCreatedByAdminRule extends FlowRule |
||
| 13 | { |
||
| 14 | final public const RULE_NAME = 'orderCreatedByAdmin'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @internal |
||
| 18 | */ |
||
| 19 | public function __construct(private bool $shouldOrderBeCreatedByAdmin = true) |
||
| 20 | { |
||
| 21 | parent::__construct(); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function match(RuleScope $scope): bool |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getConstraints(): array |
||
| 34 | { |
||
| 35 | return [ |
||
| 36 | 'shouldOrderBeCreatedByAdmin' => RuleConstraints::bool(true), |
||
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getConfig(): RuleConfig |
||
| 43 | } |
||
| 44 | } |
||
| 45 |