Conditions | 8 |
Paths | 26 |
Total Lines | 34 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 72 |
Changes | 0 |
1 | <?php |
||
13 | public function renderRow($element) |
||
14 | { |
||
15 | $return = ''; |
||
16 | if (!$element->isRendered()) { |
||
17 | if ($element->hasCustomRenderer()) { |
||
18 | return $element->render(); |
||
19 | } |
||
20 | |||
21 | $return .= '<div class="form-group row row-'.$element->getUniqueId().($element->isError() ? ' has-error' : '').'">'; |
||
22 | |||
23 | $renderLabel = $element->getOption('render_label'); |
||
24 | if ($renderLabel !== false) { |
||
25 | $return .= $this->renderLabel($element); |
||
26 | } |
||
27 | |||
28 | $class = ''; |
||
29 | if ($this->getForm()->hasClass('form-horizontal')) { |
||
30 | $class = $element->getType() == 'checkbox' ? 'col-sm-offset-3 col-sm-9' : 'col-sm-9'; |
||
31 | } |
||
32 | |||
33 | $return .= '<div class="'.$class.'">'; |
||
34 | $return .= $this->renderElement($element); |
||
35 | |||
36 | $helpBlock = $element->getOption('form-help'); |
||
37 | if ($helpBlock) { |
||
38 | $return .= '<span class="help-block">'.$helpBlock.'</span>'; |
||
39 | } |
||
40 | |||
41 | $return .= $element->renderErrors(); |
||
42 | $return .= '</div>'; |
||
43 | $return .= '</div>'; |
||
44 | } |
||
45 | |||
46 | return $return; |
||
47 | } |
||
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.