public function choose(array $array)
    {
        if (count($array) < 1) {
            throw new \InvalidArgumentException('Array must have at least one value');
        }

        $result = array_slice($array, $this->generator->getNumber(0, count($array) - 1), 1);

        return current($result);
    }
public function choose(array $array)
    {
        if (count($array) < 1) {
            throw new \InvalidArgumentException('Array must have at least one value');
        }

        $result = array_slice($array, $this->generator->getNumber(0, count($array) - 1), 1);

        return current($result);
    }
public function choose ( array $ array ) { if ( count ( $ array ) < 1 ) { throw new \ InvalidArgumentException ( 'Array must have at least one value' ) ; } $ result = array_slice ( $ array , $ this -> generator -> getNumber ( 0 , count ( $ array ) - 1 ) , 1 ) ; return current ( $ result ) ; }
Returns one randomly selected value from the array.
@param array $array The array to choose from
@return mixed One randomly selected value from the array
@throws \InvalidArgumentException If the array is empty
Returns one randomly selected value from the array .