WP_AI_Client_Cache::iterable_to_array │ private │ WP 7.0.0

Converts an iterable to an array.

Метод класса: WP_AI_Client_Cache{}

Хуков нет.

Возвращает

array<mixed>. The array.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->iterable_to_array( $items ): array;
$items(iterable) (обязательный)
The iterable to convert.

Список изменений

С версии 7.0.0 Введена.

Код WP_AI_Client_Cache::iterable_to_array() WP 7.1.2

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

	return iterator_to_array( $items );
}