Documentation

SortCombinator extends Sort

Enable sorting a record based on its value.

Tags
phpstan-type

Ordering Sort|Closure(mixed, mixed): int

phpstan-type

OrderingExtended Sort|Closure(mixed, mixed): int|callable(mixed, mixed): int

Table of Contents

Methods

__invoke()  : int
The class comparison method.
append()  : self
Return an instance with the specified sorting algorithm added after the currently registered sorting algorithms.
prepend()  : self
Return an instance with the specified sorting algorithm added before the currently registered sorting algorithms.
sort()  : Iterator
Sort an iterable structure with the class comparison method and maintain index association.

Methods

__invoke()

The class comparison method.

public __invoke(mixed $valueA, mixed $valueB) : int

The method must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Parameters
$valueA : mixed
$valueB : mixed
Return values
int

append()

Return an instance with the specified sorting algorithm added after the currently registered sorting algorithms.

public append(Ordering ...$sorts) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified changes.

Parameters
$sorts : Ordering
Return values
self

prepend()

Return an instance with the specified sorting algorithm added before the currently registered sorting algorithms.

public prepend(Ordering ...$sorts) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified changes.

Parameters
$sorts : Ordering
Return values
self

sort()

Sort an iterable structure with the class comparison method and maintain index association.

public sort(iterable<string|int, mixed> $value) : Iterator
Parameters
$value : iterable<string|int, mixed>
Return values
Iterator

        
On this page

Search results