Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\ArrayValueCollector Class Reference

Static Public Member Functions

static collectValues (array $data, array $ignore=[])
 Recursively collects values from nested arrays. More...
 

Static Private Member Functions

static collectValuesInternal (array $data, array $flippedIgnoreArray, array &$values=[])
 Recursively collects values from nested arrays. More...
 

Detailed Description

Member Function Documentation

◆ collectValues()

static Wikibase\Repo\ArrayValueCollector::collectValues ( array  $data,
array  $ignore = [] 
)
static

Recursively collects values from nested arrays.

Parameters
array$dataThe array structure to process.
array$ignoreA list of keys to skip.
Returns
array The values found in the array structure.

◆ collectValuesInternal()

static Wikibase\Repo\ArrayValueCollector::collectValuesInternal ( array  $data,
array  $flippedIgnoreArray,
array &  $values = [] 
)
staticprivate

Recursively collects values from nested arrays.

This function can be called tens of thousands of times, so try to keep it as lean as possible. The passing of $values by reference through the calls is a performance improvement.

Parameters
array$dataThe array structure to process.
array$flippedIgnoreArrayAn array with keys that should be flipped
array&$valuesValues from a previous call.
Returns
array The values found in the array structure.

The documentation for this class was generated from the following file: