Skip to content

Commit

Permalink
Added SensioLabs config. Fixed tiny issues suggested by SensioLabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Athari committed Oct 30, 2015
1 parent 7721aa1 commit d3c5019
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .sensiolabs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
missing_e_o_l:
enabled: false
2 changes: 0 additions & 2 deletions YaLinqo/Errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace YaLinqo;

use YaLinqo;

class Errors
{
/** Error message: "Sequence contains no elements." */
Expand Down
5 changes: 3 additions & 2 deletions YaLinqo/OrderedEnumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private function trySortBySingleField ($array, $canMultisort)
private function sortByMultipleFields ($array, $canMultisort)
{
$orders = [ ];
for ($order = $this; $order != null; $order = $order->parent) {
for ($order = $this; $order !== null; $order = $order->parent) {
$orders[] = $order;
if ($order->sortFlags === null)
$canMultisort = false;
Expand Down Expand Up @@ -240,7 +240,8 @@ private function sortIteratorWithUsort (&$enum, $orders)

usort($enum, function ($a, $b) use ($orders) {
/** @var $order OrderedEnumerable */
for ($i = 0; $i < count($orders); $i++) {
$count = count($orders);
for ($i = 0; $i < $count; $i++) {
$order = $orders[$i];
$comparer = $order->comparer;
$diff = $comparer($a[$i + 2], $b[$i + 2]);
Expand Down

0 comments on commit d3c5019

Please sign in to comment.