| 1 | <?php |
||
| 5 | trait ArrayGenerator |
||
| 6 | { |
||
| 7 | protected $array = false; |
||
| 8 | |||
| 9 | protected $items = []; |
||
| 10 | |||
| 11 | protected $count = 1; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Set the array items count. |
||
| 15 | * |
||
| 16 | * @param $count |
||
| 17 | * @return $this |
||
| 18 | */ |
||
| 19 | 1 | public function count($count) |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Generate random array elements. |
||
| 28 | * |
||
| 29 | * @return array |
||
| 30 | */ |
||
| 31 | 1 | protected function generateArray() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Generate a random integer. |
||
| 50 | * |
||
| 51 | * @param int $start |
||
| 52 | * @param int $end |
||
| 53 | * @return int |
||
| 54 | */ |
||
| 55 | abstract protected function generateRandomInt($start, $end); |
||
| 56 | } |
||
| 57 |