WordPress\AiClient\Providers\Models\DTO

SupportedOption::normalizeArrayForComparisonprivate staticWP 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. 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.0

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