WooCommerce Code Reference

Count implements TransformerInterface

Count elements in Array or Countable object.

Interfaces, Classes and Traits

TransformerInterface
An interface to define a transformer.

Table of Contents

transform()  : number
Count elements in Array or Countable object.
validate()  : mixed
Validate Transformer arguments.

Methods

transform()

Count elements in Array or Countable object.

public transform(array<string|int, mixed>|Countable $value[, stdClass|null $arguments = null ][, string|null $default_value = null ]) : number
Parameters
$value : array<string|int, mixed>|Countable

an array to count.

$arguments : stdClass|null = null

arguments.

$default_value : string|null = null

default value.

Return values
number