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