wiki.techinc.nl/includes/collation
Bartosz Dziewoński b191e5e860 Use PHP 7 '<=>' operator in 'sort()' callbacks
`$a <=> $b` returns `-1` if `$a` is lesser, `1` if `$b` is lesser,
and `0` if they are equal, which are exactly the values 'sort()'
callbacks are supposed to return.

It also enables the neat idiom `$a[x] <=> $b[x] ?: $a[y] <=> $b[y]`
to sort arrays of objects first by 'x', and by 'y' if they are equal.

* Replace a common pattern like `return $a < $b ? -1 : 1` with the
  new operator (and similar patterns with the variables, the numbers
  or the comparison inverted). Some of the uses were previously not
  correctly handling the variables being equal; this is now
  automatically fixed.
* Also replace `return $a - $b`, which is equivalent to `return
  $a <=> $b` if both variables are integers but less intuitive.
* (Do not replace `return strcmp( $a, $b )`. It is also equivalent
  when both variables are strings, but if any of the variables is not,
  'strcmp()' converts it to a string before comparison, which could
  give different results than '<=>', so changing this would require
  careful review and isn't worth it.)
* Also replace `return $a > $b`, which presumably sort of works most
  of the time (returns `1` if `$b` is lesser, and `0` if they are
  equal or `$a` is lesser) but is erroneous.

Change-Id: I19a3d2fc8fcdb208c10330bd7a42c4e05d7f5cf3
2018-05-30 18:05:20 -07:00
..
AbkhazUppercaseCollation.php Add collation for Abkhaz (ab) 2017-12-25 14:37:14 +00:00
BashkirUppercaseCollation.php Add collation for Bashkir (ba) 2017-05-10 04:17:46 +00:00
Collation.php Remove everything related to CollationFa 2018-05-18 18:33:25 +02:00
CollationCkb.php
CollationEt.php includes: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 18:13:24 +00:00
CustomUppercaseCollation.php Add collation for Abkhaz (ab) 2017-12-25 14:37:14 +00:00
IcuCollation.php Use PHP 7 '<=>' operator in 'sort()' callbacks 2018-05-30 18:05:20 -07:00
IdentityCollation.php
NorthernSamiUppercaseCollation.php Add custom collation for Northern Sami 2017-12-07 21:32:11 +00:00
NumericUppercaseCollation.php Fix typo in 'language' 2017-10-07 18:53:04 +02:00
UppercaseCollation.php