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

@@ 180-187 (lines=8) @@
177
		}, $index,$attributes,"ck");
178
	}
179
180
	public function fieldAsDropDown($index,$elements=[],$multiple=false,$attributes=NULL){
181
		return $this->_fieldAs(function($id,$name,$value) use($elements,$multiple){
182
			$dd=new HtmlFormDropdown($id,$elements,NULL,$value);
183
			$dd->asSelect($name,$multiple);
184
			return $dd;
185
		}, $index,$attributes,"dd");
186
	}
187
188
	public function fieldAsMessage($index,$attributes=NULL){
189
		return $this->_fieldAs(function($id,$name,$value,$caption){
190
			$mess= new HtmlMessage("message-".$id,$value);