naturalsort_defaultcollator.php 354 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * Copyright (c) 2014 Vincent Petry <PVince81@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. *
  8. */
  9. namespace OC;
  10. class NaturalSort_DefaultCollator {
  11. public function compare($a, $b) {
  12. if ($a === $b) {
  13. return 0;
  14. }
  15. return ($a < $b) ? -1 : 1;
  16. }
  17. }