Code Duplication    Length = 7-8 lines in 2 locations

Ajax/semantic/widgets/dataform/FormFieldAsTrait.php 1 location

@@ 90-96 (lines=7) @@
87
		}, $index,$attributes);
88
	}
89
90
	public function fieldAsDropDown($index,$elements=[],$multiple=false,$attributes=NULL){
91
		return $this->_fieldAs(function($id,$name,$value,$caption) use ($elements,$multiple){
92
			$dd=new HtmlFormDropdown($id,$elements,$caption,$value,$multiple);
93
			$dd->setName($name);
94
			return $dd;
95
		}, $index,$attributes);
96
	}
97
98
	public function fieldAsMessage($index,$attributes=NULL){
99
		return $this->_fieldAs(function($id,$name,$value,$caption){

Ajax/semantic/widgets/base/FieldAsTrait.php 1 location

@@ 156-163 (lines=8) @@
153
		}, $index,$attributes,"ck");
154
	}
155
156
	public function fieldAsDropDown($index,$elements=[],$multiple=false,$attributes=NULL){
157
		return $this->_fieldAs(function($id,$name,$value) use($elements,$multiple){
158
			//$dd=new HtmlDropdown($id,$value,$elements);
159
			$dd=new HtmlFormDropdown($id,$elements,NULL,$value);
160
			$dd->asSelect($name,$multiple);
161
			return $dd;
162
		}, $index,$attributes,"dd");
163
	}
164
}