Automattic\WooCommerce\Blueprint
ClassExtractor::replace_method_variable
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() ClassExtractor::replace method variable code WC 10.5.0
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;
}