schmittjoh/php-collection — pull request #2 by matthiasnoback (2013-01-23 15:02:17+00:00)
Title: Made sorting behavior compliant with usort

Hi Johannes,

First of all, thanks for another great PHP library!

I stumbled upon a compliance-issue: according to the ``usort`` documentation (http://php.net/manual/en/function.usort.php) a callable may return numbers below, equal to and above 0. But the code of ``SortedSequence`` relies on the return value to be -1, or something else. Since the initial sorting of elements is done using ``usort``, I think it would be best to comply to the ``usort`` in the way it handles return values (and also convert the return value to an integer). This also allows you to use simpler sort functions, like ``return $a - $b``.