Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

EvaluateSuggestion::evaluate()public staticWC 1.0

Evaluates the spec and returns the suggestion.

{} It's a method of the class: EvaluateSuggestion{}

No Hooks.

Return

Object. The evaluated suggestion.

Usage

$result = EvaluateSuggestion::evaluate( $spec );
$spec(object|array) (required)
The suggestion to evaluate.

Code of EvaluateSuggestion::evaluate() WC 6.7.0

public static function evaluate( $spec ) {
	$rule_evaluator = new RuleEvaluator();
	$suggestion     = is_array( $spec ) ? (object) $spec : clone $spec;

	if ( isset( $suggestion->is_visible ) ) {
		$is_visible             = $rule_evaluator->evaluate( $suggestion->is_visible );
		$suggestion->is_visible = $is_visible;
	}

	return $suggestion;
}