| 1 | <?php |
||
| 13 | class Exactly extends Counter |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var int Target count |
||
| 17 | */ |
||
| 18 | private $count; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Load expressions |
||
| 22 | * |
||
| 23 | * @param int $count |
||
| 24 | * @param ExpressionInterface ...$exprs Any number of expressions |
||
| 25 | */ |
||
| 26 | public function __construct(int $count, ExpressionInterface ...$exprs) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Evaluate that the exact number of contained expressions returns true |
||
| 34 | */ |
||
| 35 | public function evaluate($operand): bool |
||
| 47 | } |
||
| 48 |