WooCommerce Code Reference

EvaluateSuggestion
in package

Evaluates the spec and returns the evaluated suggestion.

Table of Contents

$memo  : array<string|int, mixed>
Stores memoized results of evaluate_specs.
evaluate()  : object
Evaluates the spec and returns the suggestion.
evaluate_specs()  : array<string|int, mixed>
Evaluates the specs and returns the visible suggestions.
reset_memo()  : mixed
Resets the memoized results. Useful for testing.
get_memo_key()  : string
Returns a memoization key for the given specs.

Properties

Methods

evaluate()

Evaluates the spec and returns the suggestion.

public static evaluate(object|array<string|int, mixed> $spec[, array<string|int, mixed> $logger_args = array() ]) : object
Parameters
$spec : object|array<string|int, mixed>

The suggestion to evaluate.

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

Optional. Arguments for the rule evaluator logger.

Return values
objectThe evaluated suggestion.

evaluate_specs()

Evaluates the specs and returns the visible suggestions.

public static evaluate_specs(array<string|int, mixed> $specs[, array<string|int, mixed> $logger_args = array() ]) : array<string|int, mixed>
Parameters
$specs : array<string|int, mixed>

payment suggestion spec array.

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

Optional. Arguments for the rule evaluator logger.

Return values
array<string|int, mixed>The visible suggestions and errors.