PHP Semver

Sortable

This trait used to sort Version arrays.

Table of Contents

Methods

rsort()  : array<string|int, Version>
Sorts an array of versions in reverse order.
rsortString()  : array<string|int, string>
Sorts an array of version strings in reverse order.
sort()  : array<string|int, Version>
Sorts an array of versions.
sortString()  : array<string|int, string>
Sorts an array of version strings.

Methods

rsort()

Sorts an array of versions in reverse order.

public static rsort(array<string|int, Version$versions) : array<string|int, Version>
Parameters
$versions : array<string|int, Version>

the versions to sort

Return values
array<string|int, Version>

the sorted array of versions

rsortString()

Sorts an array of version strings in reverse order.

public static rsortString(array<string|int, string> $versions) : array<string|int, string>
Parameters
$versions : array<string|int, string>

the version strings to sort

Tags
throws
SemverException

when the given array contains an invalid version string

Return values
array<string|int, string>

the sorted array of version strings

sort()

Sorts an array of versions.

public static sort(array<string|int, Version$versions) : array<string|int, Version>
Parameters
$versions : array<string|int, Version>

the versions to sort

Return values
array<string|int, Version>

the sorted array of versions

sortString()

Sorts an array of version strings.

public static sortString(array<string|int, string> $versions) : array<string|int, string>
Parameters
$versions : array<string|int, string>

the version strings to sort

Tags
throws
SemverException

when the given array contains an invalid version string

Return values
array<string|int, string>

the sorted array of version strings


        
On this page

Search results