| @@ 376-393 (lines=18) @@ | ||
| 373 | }); |
|
| 374 | $operands = [reset($operands)]; |
|
| 375 | } |
|
| 376 | elseif (BelowRule::operator == $operator) { |
|
| 377 | usort($operands, function( BelowRule $a, BelowRule $b ) { |
|
| 378 | if (null === $a->getMaximum()) { |
|
| 379 | return 1; |
|
| 380 | } |
|
| 381 | ||
| 382 | if (null === $b->getMaximum()) { |
|
| 383 | return -1; |
|
| 384 | } |
|
| 385 | ||
| 386 | if ($a->getMaximum() < $b->getMaximum()) { |
|
| 387 | return -1; |
|
| 388 | } |
|
| 389 | ||
| 390 | return 1; |
|
| 391 | }); |
|
| 392 | $operands = [reset($operands)]; |
|
| 393 | } |
|
| 394 | elseif (EqualRule::operator == $operator) { |
|
| 395 | // TODO add an option for the support strict comparison |
|
| 396 | foreach ($operands as $i => $operand) { |
|
| @@ 184-201 (lines=18) @@ | ||
| 181 | }); |
|
| 182 | $operands = [reset($operands)]; |
|
| 183 | } |
|
| 184 | elseif (BelowRule::operator == $operator) { |
|
| 185 | usort($operands, function( BelowRule $a, BelowRule $b ) { |
|
| 186 | if (null === $a->getMaximum()) { |
|
| 187 | return 1; |
|
| 188 | } |
|
| 189 | ||
| 190 | if (null === $b->getMaximum()) { |
|
| 191 | return -1; |
|
| 192 | } |
|
| 193 | ||
| 194 | if ($a->getMaximum() > $b->getMaximum()) { |
|
| 195 | return -1; |
|
| 196 | } |
|
| 197 | ||
| 198 | return 1; |
|
| 199 | }); |
|
| 200 | $operands = [reset($operands)]; |
|
| 201 | } |
|
| 202 | elseif (InRule::operator == $operator) { |
|
| 203 | $first_in = reset($operands); |
|
| 204 | ||