1 | <?php |
||
9 | class All extends AbstractGenerator implements Generator |
||
10 | { |
||
11 | /** @type array The other generators to use. */ |
||
12 | protected $_generators; |
||
13 | |||
14 | /** @type Cinam\Randomizer\Randomizer The random number generator. */ |
||
15 | protected $_randomizer; |
||
16 | |||
17 | /** |
||
18 | * Initializes the All Generator with the list of generators to choose from. |
||
19 | * |
||
20 | * @api |
||
21 | * @param array $generators The random generators to use. |
||
22 | * @param \Cinam\Randomizer\Randomizer $randomizer The random number generator. |
||
23 | */ |
||
24 | public function __construct(array $generators, Randomizer $randomizer = null) |
||
29 | |||
30 | /** |
||
31 | * Constructs an All Generator using the default list of generators. |
||
32 | * |
||
33 | * @api |
||
34 | * @param \Cinam\Randomizer\Randomizer $randomizer The random number generator. |
||
35 | * @return \Nubs\RandomNameGenerator\All The constructed generator. |
||
36 | */ |
||
37 | public static function create(Randomizer $randomizer = null) |
||
41 | |||
42 | /** |
||
43 | * Gets a randomly generated name using the configured generators. |
||
44 | * |
||
45 | * @api |
||
46 | * @return string A random name. |
||
47 | */ |
||
48 | public function getName() |
||
52 | |||
53 | /** |
||
54 | * Get a random generator from the list of generators. |
||
55 | * |
||
56 | * @return \Nubs\RandomNameGenerator\Generator A random generator. |
||
57 | */ |
||
58 | protected function _getRandomGenerator() |
||
62 | } |
||
63 |