Panel::setButtons()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
namespace Ext\Panel;
3
4
5
use Ext\Container\Container;
6
7 View Code Duplication
class Panel extends Container
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...
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