Code Duplication    Length = 43-55 lines in 2 locations

src/Container/Container.php 1 location

@@ 8-50 (lines=43) @@
5
use Ext\Component;
6
use Ext\Plugin\Base;
7
8
class Container extends Component
9
{
10
	public function addItem(Component $item){
11
		return $this->add('items',$item);
12
	}
13
14
	public function setItems(array $items){
15
		foreach($items as $item)
16
			$this->addItem($item);
17
		return $this;
18
	}
19
20
	public function setLayout($layout){
21
		return $this->setProperty('layout',$layout);
22
	}
23
24
	public function setPlugins(array $plugins){
25
		foreach($plugins as $plugin){
26
			$this->addPlugin($plugin);
27
		}
28
		return $this;
29
	}
30
31
	public function addPlugin(Base $plugin){
32
		return $this->add('plugins',$plugin);
33
	}
34
35
	public function getPlugins(){
36
		return $this->getProperty('plugins');
37
	}
38
39
	public function setAutoDestroy($autoDestroy){
40
		return $this->setProperty('autoDestroy',$autoDestroy);
41
	}
42
43
	public function getAutoDestroy(){
44
		return $this->getProperty('autoDestroy');
45
	}
46
47
48
49
50
}

src/Panel/Panel.php 1 location

@@ 7-61 (lines=55) @@
4
5
use Ext\Container\Container;
6
7
class Panel extends Container
8
{
9
	public function setTitle($title){
10
		return $this->setProperty('title',$title);
11
	}
12
13
	public function setHeader(Header $header){
14
		return  $this->setProperty('header',$header);
15
	}
16
17
	public function addTool(Tool $tool){
18
		return $this->add('tools',$tool);
19
	}
20
21
	public function addDockedItem($dockedItem){
22
		return $this->add('dockedItems',$dockedItem);
23
	}
24
25
	public function setDockedItems(array $dockedItems){
26
		foreach($dockedItems as $dockedItem){
27
			$this->addDockedItem($dockedItem);
28
		}
29
		return $this;
30
	}
31
32
33
	/**
34
	 * True to make the panel collapsible and have an expand/collapse toggle Tool added into the header tool button area.
35
	 * @param bool $collapsible
36
	 * @return $this
37
	 */
38
	public function setCollapsible($collapsible){
39
		return $this->setProperty('collapsible',(bool)$collapsible);
40
	}
41
	
42
	public function setButtons(array $buttons){
43
		foreach($buttons as $button){
44
			$this->addButton($button);
45
		}
46
		return $this;
47
	}
48
49
	public function getButtons(){
50
		return $this->getProperty('buttons');
51
	}
52
53
	public function addButton($button){
54
		return $this->add('buttons',$button);
55
	}
56
	
57
	
58
59
60
61
}
62