WooCommerce Code Reference

RuleEvaluator
in package

Evaluate the given rules as an AND operation - return false early if a rule evaluates to false.

Table of Contents

$get_rule_processor  : GetRuleProcessor
GetRuleProcessor to use.
__construct()  : mixed
Constructor.
evaluate()  : bool
Evaluate the given rules as an AND operation - return false early if a rule evaluates to false.

Properties

Methods

evaluate()

Evaluate the given rules as an AND operation - return false early if a rule evaluates to false.

public evaluate(array<string|int, mixed>|object $rules[, object|null $stored_state = null ][, array<string|int, mixed> $logger_args = array() ]) : bool
Parameters
$rules : array<string|int, mixed>|object

The rule or rules being processed.

$stored_state : object|null = null

Stored state.

$logger_args : array<string|int, mixed> = array()

Arguments for the event logger. slug is required.

Tags
throws
InvalidArgumentException

Thrown when $logger_args is missing slug.

Return values
boolThe result of the operation.