| 1 | <?php |
||
| 11 | trait EnforcementTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Enforcement|null |
||
| 15 | */ |
||
| 16 | private $enforcement; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string|Throwable $throwable |
||
| 20 | * @param array ...$args |
||
| 21 | * |
||
| 22 | * @return $this |
||
| 23 | */ |
||
|
|
|||
| 24 | final public function orThrow($throwable, ...$args) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return bool |
||
| 35 | */ |
||
| 36 | final public function verify(): bool |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param bool $condition |
||
| 49 | * |
||
| 50 | * @return $this |
||
| 51 | */ |
||
| 52 | final protected function enforce(bool $condition) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * |
||
| 61 | */ |
||
| 62 | private function approveEnforcement() |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return bool |
||
| 71 | */ |
||
| 72 | final protected function isEnforcementFulfilled(): bool |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return bool |
||
| 79 | */ |
||
| 80 | private function hasEnforcement(): bool |
||
| 84 | } |