Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers
Count::transform()
Count elements in Array or Countable object.
@param array|Countable $value an array to count. @param stdClass|null $arguments arguments. @param string|null $default_value default value.
@return number
Method of the class: Count{}
No Hooks.
Return
null
. Nothing (null).
Usage
$Count = new Count(); $Count->transform( $value, ?stdClass $arguments, $default_value );
- $value (required)
- -
- ?stdClass $arguments **
- -
Default: null - $default_value **
- -
Default: null
Count::transform() Count::transform code WC 9.7.1
public function transform( $value, ?stdClass $arguments = null, $default_value = null ) { if ( ! is_array( $value ) && ! $value instanceof \Countable ) { return $default_value; } return count( $value ); }