Bolt\Twig\Handler\ArrayHandler::shuffle PHP Method

shuffle() public method

Randomly shuffle the contents of a passed array.
public shuffle ( array $array ) : array
$array array
return array
    public function shuffle($array)
    {
        if (is_array($array)) {
            shuffle($array);
        }
        return $array;
    }

Usage Example

Example #1
0
 /**
  * @runInSeparateProcess
  */
 public function testShuffleArray()
 {
     $app = $this->getApp();
     $this->php->expects($this->once())->method('shuffle');
     $handler = new ArrayHandler($app);
     $handler->shuffle(['shuffle', 'board']);
 }