| Conditions | 5 |
| Paths | 16 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | public function renderLabel($label, $required = false, $error = false) |
||
| 55 | { |
||
| 56 | if (is_object($label)) { |
||
| 57 | $element = $label; |
||
| 58 | $label = $element->getLabel(); |
||
| 59 | $required = $element->isRequired(); |
||
| 60 | $error = $element->isError(); |
||
| 61 | } |
||
| 62 | |||
| 63 | $return = '<label class="col-form-label '.($this->getForm()->hasClass('form-horizontal') ? ' col-sm-3' : '').($error ? '' : '').'">'; |
||
| 64 | $return .= $label.':'; |
||
| 65 | |||
| 66 | if ($required) { |
||
| 67 | $return .= '<span class="required">*</span>'; |
||
| 68 | } |
||
| 69 | |||
| 70 | $return .= "</label>"; |
||
| 71 | |||
| 72 | return $return; |
||
| 73 | } |
||
| 75 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.