| Conditions | 7 |
| Paths | 10 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 4 |
| Ratio | 18.18 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function render() |
||
| 41 | { |
||
| 42 | $ret = '<table><tr>'; |
||
| 43 | $i = 0; |
||
| 44 | View Code Duplication | if (count($this->getOptions()) > 1 && '[]' !== substr($this->getName(), -2, 2)) { |
|
| 45 | $newname = $this->getName() . '[]'; |
||
| 46 | $this->setName($newname); |
||
| 47 | } |
||
| 48 | foreach ($this->getOptions() as $value => $name) { |
||
| 49 | if (0 == (++$i) % 6) { |
||
| 50 | $ret .= '</tr><tr>'; |
||
| 51 | } |
||
| 52 | $ret .= "<td><input type='checkbox' name='" . $this->getName() . "' value='" . $value . "'"; |
||
| 53 | if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) { |
||
| 54 | $ret .= ' checked'; |
||
| 55 | } |
||
| 56 | $ret .= $this->getExtra() . '>' . $name . "</td>\n"; |
||
| 57 | } |
||
| 58 | $ret .= '</tr></table>'; |
||
| 59 | |||
| 60 | return $ret; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.