| Conditions | 5 |
| Paths | 16 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 55 | public function renderLabel($label, $required = false, $error = false) |
||
| 56 | { |
||
| 57 | if (is_object($label)) { |
||
| 58 | $element = $label; |
||
| 59 | $label = $element->getLabel(); |
||
| 60 | $required = $element->isRequired(); |
||
| 61 | $error = $element->isError(); |
||
| 62 | } |
||
| 63 | |||
| 64 | $return = '<label class="col-form-label '.($this->getForm()->hasClass('form-horizontal') ? ' col-sm-3' : '').($error ? ' error' : '').'">'; |
||
| 65 | $return .= $label.':'; |
||
| 66 | |||
| 67 | if ($required) { |
||
| 68 | $return .= '<span class="required">*</span>'; |
||
| 69 | } |
||
| 70 | |||
| 71 | $return .= "</label>"; |
||
| 72 | |||
| 73 | return $return; |
||
| 74 | } |
||
| 76 |
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.