src/precore/util/Collections.php
public static function sort(ArrayObject $arrayObject, Comparator $comparator = null) : void
    {
        if ($comparator === null) {
            $comparator = ComparableComparator::instance();
        }
        $arrayObject->uasort(self::compareFunctionFor($comparator));
    }
public static function sort(ArrayObject $arrayObject, Comparator $comparator = null) : void
    {
        if ($comparator === null) {
            $comparator = ComparableComparator::instance();
        }
        $arrayObject->uasort(self::compareFunctionFor($comparator));
    }
Sorts the specified object according to the order induced by the specified comparator.
All elements in the object must be mutually comparable using the specified comparator
(that is, c.compare(e1, e2) must not throw a ClassCastException for any elements e1 and e2 in the object).

<p>
If the specified comparator is null, this method sorts the specified {@link ArrayObject} into ascending order,
according to the natural ordering of its elements. All elements in the object must implement
the {@link Comparable} interface. Furthermore, all elements in the object must be mutually comparable
(that is, e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in the object).

@param ArrayObject $arrayObject
@param Comparator $comparator