Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
31 | 1 | protected function generateArray() |
|
32 | { |
||
33 | 1 | $result = []; |
|
34 | |||
35 | 1 | $last = count($this->items)-1; |
|
36 | |||
37 | 1 | for ($counter = 1; $counter <= $this->count; $counter++) { |
|
38 | 1 | $result[] = $this->items[$this->generateRandomInt(0, $last)]; |
|
39 | } |
||
40 | |||
41 | 1 | if ($this->count == 1) { |
|
42 | 1 | return $result[0]; |
|
43 | } |
||
44 | |||
45 | 1 | return $result; |
|
46 | } |
||
47 | |||
57 |