NaturalSort

class OC\NaturalSort
Source:lib/private/NaturalSort.php#33

Properties

Methods

public OC\NaturalSort::__construct($injectedCollator=null)
Instantiate a new \OC\NaturalSort instance.
Source:

lib/private/NaturalSort.php#42

Parameters:
  • $injectedCollator (object)
public OC\NaturalSort::compare($a, $b)
Compare two strings to provide a natural sort
Source:

lib/private/NaturalSort.php#108

Parameters:
  • $a (string) first string to compare
  • $b (string) second string to compare
Returns:

int -1 if $b comes before $a, 1 if $a comes before $b or 0 if the strings are identical

public static OC\NaturalSort::getInstance()
Returns a singleton
Source:lib/private/NaturalSort.php#136
Returns:\OC\NaturalSort instance