| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 | } |
||
| 50 | |||
| 56 |
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
@returnannotation as described here.