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
$memo
Stores memoized results of evaluate_specs.
protected
static array<string|int, mixed>
$memo
= array()
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
object — The 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.reset_memo()
Resets the memoized results. Useful for testing.
public
static reset_memo() : mixed
Return values
mixed —get_memo_key()
Returns a memoization key for the given specs.
private
static get_memo_key(array<string|int, mixed> $specs) : string
Parameters
- $specs : array<string|int, mixed>
-
The specs to generate a key for.