Punic\Comparer::sort PHP Метод

sort() публичный Метод

public sort ( array &$array, boolean $keepKeys = false ) : array
$array array
$keepKeys boolean
Результат array
    public function sort(&$array, $keepKeys = false)
    {
        $me = $this;
        $result = null;
        if (isset($this->collator)) {
            try {
                if ($keepKeys) {
                    $result = $this->collator->asort($array);
                } else {
                    $result = $this->collator->sort($array);
                }
            } catch (PHPException $x) {
            }
        }
        if ($result === null) {
            if ($keepKeys) {
                $result = uasort($array, function ($a, $b) use($me) {
                    return $me->compare($a, $b);
                });
            } else {
                $result = usort($array, function ($a, $b) use($me) {
                    return $me->compare($a, $b);
                });
            }
        }
        return $result;
    }