SortByVersionTrait
Trait SortByVersionTrait.
Trait to provide a function for sorting version tags.
Table of Contents
- sortByVersion() : int
- Custom sort function to sort array of version string.
Methods
sortByVersion()
Custom sort function to sort array of version string.
public
sortByVersion(string $a, string $b) : int
This assumes example version format of: 1.2.0 1.2.1 1.2.2 1.2.3-alpha 1.2.3-alpha1 1.2.3-alpha2 1.2.3-beta 1.2.3-beta1 1.2.3-beta2 1.2.3-rc 1.2.3-rc1 1.2.3-rc2 1.2.3 1.3.0
Parameters
- $a : string
- $b : string