Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function generate($className, $field, $callback) |
||
33 | { |
||
34 | do { |
||
35 | $value = $callback(); |
||
36 | } while ($this->exists($className, $field, $value)); |
||
37 | |||
38 | if (!isset($this->cache[$className])) { |
||
39 | $this->cache[$className] = []; |
||
40 | } |
||
41 | |||
42 | if (!isset($this->cache[$className][$field])) { |
||
43 | $this->cache[$className][$field] = []; |
||
44 | } |
||
45 | |||
46 | $this->cache[$className][$field][] = $value; |
||
47 | |||
48 | return $value; |
||
49 | } |
||
56 |