Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function fake(array $mapping) |
||
20 | { |
||
21 | $mapping = array_merge( |
||
22 | ['fieldName' => null, 'type' => null], |
||
23 | $mapping |
||
24 | ); |
||
25 | |||
26 | $name = $mapping['fieldName']; |
||
27 | |||
28 | foreach ($this->fakers as $faker) { |
||
29 | if ($faker->isFakable($name)) { |
||
30 | return $faker->fake($name); |
||
31 | } |
||
32 | } |
||
33 | |||
34 | return $this->fake(['fieldName' => 'text' === $mapping['type'] ? 'paragraph' : 'word']); |
||
35 | } |
||
36 | |||
42 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.