1 | <?php namespace BuildR\TestTools\Traits; |
||
20 | trait FakeDataGenerator { |
||
21 | |||
22 | /** |
||
23 | * Store faker instances by locale |
||
24 | * |
||
25 | * @type \Faker\Generator[] |
||
26 | */ |
||
27 | protected $fakerInstances = []; |
||
28 | |||
29 | /** |
||
30 | * Returns a new faker instance with the defined locale. |
||
31 | * This function store created instances by locale, if you want to create |
||
32 | * a new instance pass TRUE to $forceReCreate parameter |
||
33 | * |
||
34 | * @param string $locale The locale of the instance you want |
||
35 | * @param bool $forceReCreate When passed any stored instance overwritten by a new one |
||
36 | * |
||
37 | * @return \Faker\Generator|NULL |
||
38 | */ |
||
39 | 2 | public function getFaker($locale = 'en_US', $forceReCreate = FALSE) { |
|
63 | |||
64 | } |
||
65 |