| @@ 416-426 (lines=11) @@ | ||
| 413 | /** |
|
| 414 | * {@inheritdoc} |
|
| 415 | */ |
|
| 416 | public function sort($flags = self::SORT_REGULAR) |
|
| 417 | { |
|
| 418 | $values = $this->values; |
|
| 419 | $bool = sort($values, (int) $flags); |
|
| 420 | ||
| 421 | if ($bool === false) { |
|
| 422 | throw new SortException('Sort failure'); |
|
| 423 | } |
|
| 424 | ||
| 425 | return new self($values); |
|
| 426 | } |
|
| 427 | ||
| 428 | /** |
|
| 429 | * {@inheritdoc} |
|
| @@ 431-441 (lines=11) @@ | ||
| 428 | /** |
|
| 429 | * {@inheritdoc} |
|
| 430 | */ |
|
| 431 | public function associativeSort($flags = self::SORT_REGULAR) |
|
| 432 | { |
|
| 433 | $values = $this->values; |
|
| 434 | $bool = asort($values, (int) $flags); |
|
| 435 | ||
| 436 | if ($bool === false) { |
|
| 437 | throw new SortException('Sort failure'); |
|
| 438 | } |
|
| 439 | ||
| 440 | return new self($values); |
|
| 441 | } |
|
| 442 | ||
| 443 | /** |
|
| 444 | * {@inheritdoc} |
|
| @@ 446-456 (lines=11) @@ | ||
| 443 | /** |
|
| 444 | * {@inheritdoc} |
|
| 445 | */ |
|
| 446 | public function keySort($flags = self::SORT_REGULAR) |
|
| 447 | { |
|
| 448 | $values = $this->values; |
|
| 449 | $bool = ksort($values, (int) $flags); |
|
| 450 | ||
| 451 | if ($bool === false) { |
|
| 452 | throw new SortException('Sort failure'); |
|
| 453 | } |
|
| 454 | ||
| 455 | return new self($values); |
|
| 456 | } |
|
| 457 | ||
| 458 | /** |
|
| 459 | * {@inheritdoc} |
|
| @@ 476-486 (lines=11) @@ | ||
| 473 | /** |
|
| 474 | * {@inheritdoc} |
|
| 475 | */ |
|
| 476 | public function reverseSort($flags = self::SORT_REGULAR) |
|
| 477 | { |
|
| 478 | $values = $this->values; |
|
| 479 | $bool = rsort($values, (int) $flags); |
|
| 480 | ||
| 481 | if ($bool === false) { |
|
| 482 | throw new SortException('Sort failure'); |
|
| 483 | } |
|
| 484 | ||
| 485 | return new self($values); |
|
| 486 | } |
|
| 487 | ||
| 488 | /** |
|
| 489 | * {@inheritdoc} |
|
| @@ 506-516 (lines=11) @@ | ||
| 503 | /** |
|
| 504 | * {@inheritdoc} |
|
| 505 | */ |
|
| 506 | public function associativeReverseSort($flags = self::SORT_REGULAR) |
|
| 507 | { |
|
| 508 | $values = $this->values; |
|
| 509 | $bool = arsort($values, (int) $flags); |
|
| 510 | ||
| 511 | if ($bool === false) { |
|
| 512 | throw new SortException('Sort failure'); |
|
| 513 | } |
|
| 514 | ||
| 515 | return new self($values); |
|
| 516 | } |
|
| 517 | ||
| 518 | /** |
|
| 519 | * {@inheritdoc} |
|
| @@ 521-531 (lines=11) @@ | ||
| 518 | /** |
|
| 519 | * {@inheritdoc} |
|
| 520 | */ |
|
| 521 | public function keyReverseSort($flags = self::SORT_REGULAR) |
|
| 522 | { |
|
| 523 | $values = $this->values; |
|
| 524 | $bool = krsort($values, (int) $flags); |
|
| 525 | ||
| 526 | if ($bool === false) { |
|
| 527 | throw new SortException('Sort failure'); |
|
| 528 | } |
|
| 529 | ||
| 530 | return new self($values); |
|
| 531 | } |
|
| 532 | ||
| 533 | /** |
|
| 534 | * {@inheritdoc} |
|
| @@ 551-561 (lines=11) @@ | ||
| 548 | /** |
|
| 549 | * {@inheritdoc} |
|
| 550 | */ |
|
| 551 | public function naturalSort() |
|
| 552 | { |
|
| 553 | $values = $this->values; |
|
| 554 | $bool = natsort($values); |
|
| 555 | ||
| 556 | if ($bool === false) { |
|
| 557 | throw new SortException('Sort failure'); |
|
| 558 | } |
|
| 559 | ||
| 560 | return new self($values); |
|
| 561 | } |
|
| 562 | ||
| 563 | /** |
|
| 564 | * {@inheritdoc} |
|