Conditions | 7 |
Paths | 12 |
Total Lines | 30 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function renderOptions($options = false) |
||
17 | { |
||
18 | $options = $options ? $options : $this->getElement()->getOptions(); |
||
19 | $return = ''; |
||
20 | |||
21 | $selectedValue = $this->getElement()->getValue(); |
||
|
|||
22 | |||
23 | foreach ($options as $value=>$atribs) { |
||
24 | if (is_string($value) && !isset($atribs['label'])) { |
||
25 | $return .= '<optgroup label="' . $value . '">'; |
||
26 | $return .= $this->renderOptions($atribs); |
||
27 | $return .= '</optgroup>'; |
||
28 | } else { |
||
29 | $return .= '<option'; |
||
30 | |||
31 | $label = $atribs['label']; |
||
32 | unset($atribs['label']); |
||
33 | |||
34 | $atribs['value'] = $value; |
||
35 | if ($this->isOptionSelected($value, $selectedValue)) { |
||
36 | $atribs['selected'] = 'selected'; |
||
37 | } |
||
38 | |||
39 | foreach ($atribs as $name=>$value) { |
||
40 | $return .= ' ' . $name . '="' . $value . '"'; |
||
41 | } |
||
42 | $return .= '>' . $label . '</option>'; |
||
43 | } |
||
44 | } |
||
45 | return $return; |
||
46 | } |
||
68 |
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.