WP_AI_Client_Cache::iterable_to_arrayprivateWP 7.0.0

Converts an iterable to an array.

Method of the class: WP_AI_Client_Cache{}

No Hooks.

Returns

Array. The array.

Usage

// private - for code of main (parent) class only
$result = $this->iterable_to_array( $items ): array;
$items(iterable) (required)
The iterable to convert.

Changelog

Since 7.0.0 Introduced.

WP_AI_Client_Cache::iterable_to_array() code WP 7.0

private function iterable_to_array( $items ): array {
	if ( is_array( $items ) ) {
		return $items;
	}

	return iterator_to_array( $items );
}