Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers

ArrayKeys{}WC 1.0

Search array value by one of its key.

No Hooks.

Usage

$ArrayKeys = new ArrayKeys();
// use class methods

Methods

  1. public transform( $value, stdClass $arguments = null, $default = null )
  2. public validate( stdClass $arguments = null )

Notes

  • Package: Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers

Code of ArrayKeys{} WC 7.1.0

class ArrayKeys implements TransformerInterface {
	/**
	 * Search array value by one of its key.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments arguments.
	 * @param string|null   $default default value.
	 *
	 * @return mixed
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		return array_keys( $value );
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		return true;
	}
}