Qaribou\Collection\ImmArray::arraySort PHP Method

arraySort() protected method

Fallback behaviour to use the builtin array sort functions
protected arraySort ( callable $cb = null ) : ImmArray
$cb callable The callback for comparison
return ImmArray
    protected function arraySort(callable $cb = null)
    {
        $ar = $this->toArray();
        if ($cb) {
            usort($ar, $cb);
        } else {
            sort($ar);
        }
        return static::fromArray($ar);
    }