Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function datalist( $entries = [] ) { |
||
37 | $this->defaultAttribute('list', "list-{$this->id}"); |
||
38 | $datalist = "<datalist id=\"list-{$this->id}\">"; |
||
39 | foreach($entries as $k => $v) { |
||
40 | $datalist .= "<option value=\"{$k}\">{$v}</option>"; |
||
41 | } |
||
42 | $datalist .= "</datalist>"; |
||
43 | $this->append($datalist); |
||
44 | } |
||
45 | } |
||
46 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.