@@ 420-430 (lines=11) @@ | ||
417 | /** |
|
418 | * {@inheritdoc} |
|
419 | */ |
|
420 | public function sort($flags = SORT_REGULAR) |
|
421 | { |
|
422 | $values = $this->values; |
|
423 | $bool = sort($values, (int) $flags); |
|
424 | ||
425 | if ($bool === false) { |
|
426 | throw new SortException('Sort failure'); |
|
427 | } |
|
428 | ||
429 | return new self($values); |
|
430 | } |
|
431 | ||
432 | /** |
|
433 | * {@inheritdoc} |
|
@@ 435-445 (lines=11) @@ | ||
432 | /** |
|
433 | * {@inheritdoc} |
|
434 | */ |
|
435 | public function associativeSort($flags = SORT_REGULAR) |
|
436 | { |
|
437 | $values = $this->values; |
|
438 | $bool = asort($values, (int) $flags); |
|
439 | ||
440 | if ($bool === false) { |
|
441 | throw new SortException('Sort failure'); |
|
442 | } |
|
443 | ||
444 | return new self($values); |
|
445 | } |
|
446 | ||
447 | /** |
|
448 | * {@inheritdoc} |
|
@@ 450-460 (lines=11) @@ | ||
447 | /** |
|
448 | * {@inheritdoc} |
|
449 | */ |
|
450 | public function keySort($flags = SORT_REGULAR) |
|
451 | { |
|
452 | $values = $this->values; |
|
453 | $bool = ksort($values, (int) $flags); |
|
454 | ||
455 | if ($bool === false) { |
|
456 | throw new SortException('Sort failure'); |
|
457 | } |
|
458 | ||
459 | return new self($values); |
|
460 | } |
|
461 | ||
462 | /** |
|
463 | * {@inheritdoc} |
|
@@ 480-490 (lines=11) @@ | ||
477 | /** |
|
478 | * {@inheritdoc} |
|
479 | */ |
|
480 | public function reverseSort($flags = SORT_REGULAR) |
|
481 | { |
|
482 | $values = $this->values; |
|
483 | $bool = rsort($values, (int) $flags); |
|
484 | ||
485 | if ($bool === false) { |
|
486 | throw new SortException('Sort failure'); |
|
487 | } |
|
488 | ||
489 | return new self($values); |
|
490 | } |
|
491 | ||
492 | /** |
|
493 | * {@inheritdoc} |
|
@@ 510-520 (lines=11) @@ | ||
507 | /** |
|
508 | * {@inheritdoc} |
|
509 | */ |
|
510 | public function associativeReverseSort($flags = SORT_REGULAR) |
|
511 | { |
|
512 | $values = $this->values; |
|
513 | $bool = arsort($values, (int) $flags); |
|
514 | ||
515 | if ($bool === false) { |
|
516 | throw new SortException('Sort failure'); |
|
517 | } |
|
518 | ||
519 | return new self($values); |
|
520 | } |
|
521 | ||
522 | /** |
|
523 | * {@inheritdoc} |
|
@@ 525-535 (lines=11) @@ | ||
522 | /** |
|
523 | * {@inheritdoc} |
|
524 | */ |
|
525 | public function keyReverseSort($flags = SORT_REGULAR) |
|
526 | { |
|
527 | $values = $this->values; |
|
528 | $bool = krsort($values, (int) $flags); |
|
529 | ||
530 | if ($bool === false) { |
|
531 | throw new SortException('Sort failure'); |
|
532 | } |
|
533 | ||
534 | return new self($values); |
|
535 | } |
|
536 | ||
537 | /** |
|
538 | * {@inheritdoc} |