| @@ 409-419 (lines=11) @@ | ||
| 406 | /** |
|
| 407 | * {@inheritdoc} |
|
| 408 | */ |
|
| 409 | public function sort($flags = SORT_REGULAR) |
|
| 410 | { |
|
| 411 | $values = $this->values; |
|
| 412 | $bool = sort($values, (int) $flags); |
|
| 413 | ||
| 414 | if ($bool === false) { |
|
| 415 | throw new SortException('Sort failure'); |
|
| 416 | } |
|
| 417 | ||
| 418 | return new self($values); |
|
| 419 | } |
|
| 420 | ||
| 421 | /** |
|
| 422 | * {@inheritdoc} |
|
| @@ 424-434 (lines=11) @@ | ||
| 421 | /** |
|
| 422 | * {@inheritdoc} |
|
| 423 | */ |
|
| 424 | public function associativeSort($flags = SORT_REGULAR) |
|
| 425 | { |
|
| 426 | $values = $this->values; |
|
| 427 | $bool = asort($values, (int) $flags); |
|
| 428 | ||
| 429 | if ($bool === false) { |
|
| 430 | throw new SortException('Sort failure'); |
|
| 431 | } |
|
| 432 | ||
| 433 | return new self($values); |
|
| 434 | } |
|
| 435 | ||
| 436 | /** |
|
| 437 | * {@inheritdoc} |
|
| @@ 439-449 (lines=11) @@ | ||
| 436 | /** |
|
| 437 | * {@inheritdoc} |
|
| 438 | */ |
|
| 439 | public function keySort($flags = SORT_REGULAR) |
|
| 440 | { |
|
| 441 | $values = $this->values; |
|
| 442 | $bool = ksort($values, (int) $flags); |
|
| 443 | ||
| 444 | if ($bool === false) { |
|
| 445 | throw new SortException('Sort failure'); |
|
| 446 | } |
|
| 447 | ||
| 448 | return new self($values); |
|
| 449 | } |
|
| 450 | ||
| 451 | /** |
|
| 452 | * {@inheritdoc} |
|
| @@ 469-479 (lines=11) @@ | ||
| 466 | /** |
|
| 467 | * {@inheritdoc} |
|
| 468 | */ |
|
| 469 | public function reverseSort($flags = SORT_REGULAR) |
|
| 470 | { |
|
| 471 | $values = $this->values; |
|
| 472 | $bool = rsort($values, (int) $flags); |
|
| 473 | ||
| 474 | if ($bool === false) { |
|
| 475 | throw new SortException('Sort failure'); |
|
| 476 | } |
|
| 477 | ||
| 478 | return new self($values); |
|
| 479 | } |
|
| 480 | ||
| 481 | /** |
|
| 482 | * {@inheritdoc} |
|
| @@ 499-509 (lines=11) @@ | ||
| 496 | /** |
|
| 497 | * {@inheritdoc} |
|
| 498 | */ |
|
| 499 | public function associativeReverseSort($flags = SORT_REGULAR) |
|
| 500 | { |
|
| 501 | $values = $this->values; |
|
| 502 | $bool = arsort($values, (int) $flags); |
|
| 503 | ||
| 504 | if ($bool === false) { |
|
| 505 | throw new SortException('Sort failure'); |
|
| 506 | } |
|
| 507 | ||
| 508 | return new self($values); |
|
| 509 | } |
|
| 510 | ||
| 511 | /** |
|
| 512 | * {@inheritdoc} |
|
| @@ 514-524 (lines=11) @@ | ||
| 511 | /** |
|
| 512 | * {@inheritdoc} |
|
| 513 | */ |
|
| 514 | public function keyReverseSort($flags = SORT_REGULAR) |
|
| 515 | { |
|
| 516 | $values = $this->values; |
|
| 517 | $bool = krsort($values, (int) $flags); |
|
| 518 | ||
| 519 | if ($bool === false) { |
|
| 520 | throw new SortException('Sort failure'); |
|
| 521 | } |
|
| 522 | ||
| 523 | return new self($values); |
|
| 524 | } |
|
| 525 | ||
| 526 | /** |
|
| 527 | * {@inheritdoc} |
|