Code Duplication    Length = 11-11 lines in 2 locations

Ajax/common/html/HtmlCollection.php 1 location

@@ 15-25 (lines=11) @@
12
		$this->content=array();
13
	}
14
15
	public function addItems($items){
16
		if(JArray::isAssociative($items)){
17
			foreach ($items as $k=>$v){
18
				$this->addItem([$k,$v]);
19
			}
20
		}else{
21
			foreach ($items as $item){
22
				$this->addItem($item);
23
			}
24
		}
25
	}
26
27
	public function setItems($items){
28
		$this->content=$items;

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

@@ 52-62 (lines=11) @@
49
		$this->input=new HtmlInput($name,"hidden");
50
	}
51
52
	public function addItems($items){
53
		if(JArray::isAssociative($items)){
54
			foreach ($items as $k=>$v){
55
				$this->addItem($v)->setData($k);
56
			}
57
		}else{
58
			foreach ($items as $item){
59
				$this->addItem($item);
60
			}
61
		}
62
	}
63
64
	/**
65
	 * @param boolean $dropdown