Code Duplication    Length = 11-12 lines in 2 locations

Ajax/semantic/html/modules/HtmlDropdown.php 1 location

@@ 86-96 (lines=11) @@
83
		$this->input=new HtmlInput($name,"hidden");
84
	}
85
86
	public function addItems($items){
87
		if(JArray::isAssociative($items)){
88
			foreach ($items as $k=>$v){
89
				$this->addItem($v)->setData($k);
90
			}
91
		}else{
92
			foreach ($items as $item){
93
				$this->addItem($item);
94
			}
95
		}
96
	}
97
98
	public function count(){
99
		return \sizeof($this->items);

Ajax/common/html/HtmlCollection.php 1 location

@@ 21-32 (lines=12) @@
18
		$this->content=array();
19
	}
20
21
	public function addItems($items){
22
		if(JArray::isAssociative($items)){
23
			foreach ($items as $k=>$v){
24
				$this->addItem([$k,$v]);
25
			}
26
		}else{
27
			foreach ($items as $item){
28
				$this->addItem($item);
29
			}
30
		}
31
		return $this;
32
	}
33
34
	public function setItems($items){
35
		$this->content=$items;