src/Generators/ArrayGenerator.php
protected function generateArray()
    {
        $result = [];

        $last = count($this->items)-1;

        for ($counter = 1; $counter <= $this->count; $counter++) {
            $result[] = $this->items[$this->generateRandomInt(0, $last)];
        }

        if ($this->count == 1) {
            return $result[0];
        }

        return $result;
    }
protected function generateArray()
    {
        $result = [];

        $last = count($this->items)-1;

        for ($counter = 1; $counter <= $this->count; $counter++) {
            $result[] = $this->items[$this->generateRandomInt(0, $last)];
        }

        if ($this->count == 1) {
            return $result[0];
        }

        return $result;
    }
protected function generateArray ( ) { $ result = [ ] ; $ last = count ( $ this -> items ) - 1 ; for ( $ counter = 1 ; $ counter <= $ this -> count ; $ counter ++ ) { $ result [ ] = $ this -> items [ $ this -> generateRandomInt ( 0 , $ last ) ] ; } if ( $ this -> count == 1 ) { return $ result [ 0 ] ; } return $ result ; }
Generate random array elements.

@return array
Generate random array elements .