src/DS/Traits/TraitSequence.php
public function sort(?callable $comparator = null): Sequence
    {
        $comparator ?
            $this->items->sort($comparator) :
            $this->items->sort();

        return $this;
    }
public function sort(?callable $comparator = null): Sequence
    {
        $comparator ?
            $this->items->sort($comparator) :
            $this->items->sort();

        return $this;
    }
public function sort ( ? callable $ comparator = null ) : Sequence { $ comparator ? $ this -> items -> sort ( $ comparator ) : $ this -> items -> sort ( ) ; return $ this ; }
Sorts the sequence in-place, based on an optional callable comparator.

@param callable|null $comparator Accepts two values to be compared.
Should return the result of a <=> b.

@return \PlanB\DS\Sequence
Sorts the sequence in - place based on an optional callable comparator .