| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | function generate($name = 'default') { |
||
| 34 | $result = null; |
||
| 35 | for ($i=0; $i<self::MAX_UNIQUE_LOOPS; $i++) { |
||
| 36 | $value = $this->_generator->generate(); |
||
| 37 | try { |
||
| 38 | $this->_con->insert($this->getTableName(), array('name'=>$name, 'value'=>$value)); |
||
| 39 | $result = $value; |
||
| 40 | break; |
||
| 41 | } catch (\Exception $ex) { } |
||
| 42 | } |
||
| 43 | return $result; |
||
| 44 | } |
||
| 45 | |||
| 60 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.