@@ 613-623 (lines=11) @@ | ||
610 | /** |
|
611 | * {@inheritdoc} |
|
612 | */ |
|
613 | public function shuffle(): CollectionInterface |
|
614 | { |
|
615 | $values = $this->values; |
|
616 | $result = shuffle($values); |
|
617 | ||
618 | if ($result === false) { |
|
619 | throw new RuntimeException('Shuffle operation failed'); |
|
620 | } |
|
621 | ||
622 | return new self($values); |
|
623 | } |
|
624 | ||
625 | /** |
|
626 | * {@inheritdoc} |
|
@@ 691-700 (lines=10) @@ | ||
688 | /** |
|
689 | * {@inheritdoc} |
|
690 | */ |
|
691 | public function walk(callable $walker): CollectionInterface |
|
692 | { |
|
693 | $values = $this->values; |
|
694 | ||
695 | if (array_walk($values, $walker) === false) { |
|
696 | throw new RuntimeException('Walk operation failed'); |
|
697 | } |
|
698 | ||
699 | return new self($values); |
|
700 | } |
|
701 | ||
702 | /** |
|
703 | * {@inheritdoc} |