WordPress\AiClient\Providers\Models\DTO

SupportedOption::normalizeArrayForComparison │ private static │ WP 1.2.1

Normalizes and sorts an array for comparison.

Maps each element through normalizeValue() and sorts the result, ensuring consistent comparison regardless of element order or AbstractEnum instance identity.

Method of the class: SupportedOption{}

No Hooks.

Returns

array<mixed>. The normalized, sorted array.

Usage

$result = SupportedOption::normalizeArrayForComparison( $items ): array;
$items(array) (required)
The array to normalize.

Changelog

Since 1.2.1 Introduced.

SupportedOption::normalizeArrayForComparison() code WP 7.1.2

private static function normalizeArrayForComparison(array $items): array
{
    $normalized = array_map([self::class, 'normalizeValue'], $items);
    sort($normalized);
    return $normalized;
}