Automattic\WooCommerce\Blueprint

ClassExtractor::replace_method_variablepublicWC 1.0

Replaces a variable inside a method with a new value.

Method of the class: ClassExtractor{}

No Hooks.

Returns

$this.

Usage

$ClassExtractor = new ClassExtractor();
$ClassExtractor->replace_method_variable( $method_name, $variable_name, $new_value );
$method_name(string) (required)
Name of the method.
$variable_name(string) (required)
Name of the variable to replace.
$new_value(mixed) (required)
The new value to assign to the variable.

ClassExtractor::replace_method_variable() code WC 9.9.5

public function replace_method_variable( $method_name, $variable_name, $new_value ) {
	$this->method_variable_replacements[] = array(
		'method'   => $method_name,
		'variable' => $variable_name,
		'value'    => $new_value,
	);
	return $this;
}