Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers

ArrayKeys::transform()publicWC 1.0

Search array value by one of its key.

Method of the class: ArrayKeys{}

No Hooks.

Return

Mixed.

Usage

$ArrayKeys = new ArrayKeys();
$ArrayKeys->transform( $value, ?stdClass $arguments, $default_value );
$value(mixed) (required)
a value to transform.
?stdClass $arguments **
-
Default: null
$default_value(string|null)
default value.
Default: array()

ArrayKeys::transform() code WC 9.7.1

public function transform( $value, ?stdClass $arguments = null, $default_value = array() ) {
	if ( ! is_array( $value ) ) {
		return $default_value;
	}

	return array_keys( $value );
}