| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | public function render() { |
||
| 55 | $html = ''; |
||
| 56 | $currentValues = $this->getValue(); |
||
| 57 | $attributes = $this->attributes; |
||
| 58 | $attributes['type'] = 'checkbox'; |
||
| 59 | |||
| 60 | $name = $this->getName(); |
||
| 61 | |||
| 62 | foreach ($this->options as $value => $text) { |
||
| 63 | $attributes['value'] = $value; |
||
| 64 | $attributes['name'] = $name . '[]'; |
||
| 65 | if (in_array($value, $currentValues)) { |
||
| 66 | $attributes['checked'] = 'checked'; |
||
| 67 | } else { |
||
| 68 | unset($attributes['checked']); |
||
| 69 | } |
||
| 70 | |||
| 71 | $html .= '<label>' . static::tag('input', $attributes) . $text . '</label>'; |
||
| 72 | } |
||
| 73 | |||
| 74 | return $html; |
||
| 75 | } |
||
| 76 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..