Container::addPlugin()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
dl 3
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Ext\Container;
3
4
5
use Ext\Component;
6
use Ext\Plugin\Base;
7
8 View Code Duplication
class Container extends Component
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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
}