Completed
Push — master ( bb3350...c8eebb )
by Jean-Christophe
03:32
created

SemanticHtmlModulesTrait::htmlTab()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Ajax\semantic\traits;
4
5
use Ajax\semantic\html\collections\form\HtmlFormCheckbox;
6
use Ajax\semantic\html\base\constants\CheckboxType;
7
use Ajax\semantic\html\modules\HtmlRating;
8
use Ajax\semantic\html\modules\HtmlProgress;
9
use Ajax\semantic\html\modules\HtmlSearch;
10
use Ajax\semantic\html\modules\HtmlDimmer;
11
use Ajax\semantic\html\modules\HtmlModal;
12
use Ajax\semantic\html\modules\checkbox\HtmlCheckbox;
13
use Ajax\semantic\html\modules\HtmlTab;
14
15
trait SemanticHtmlModulesTrait {
16
17
	public abstract function addHtmlComponent($htmlComponent);
18
19
	/**
20
	 * Module checkbox
21
	 * @param string $identifier
22
	 * @param string $label
23
	 * @param mixed $value
24
	 * @param CheckboxType $type
25
	 * @return HtmlCheckbox
26
	 */
27
	public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
28
		return $this->addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type));
29
	}
30
31
	/**
32
	 *
33
	 * @param string $identifier
34
	 * @param int $rowCount
0 ignored issues
show
Bug introduced by
There is no parameter named $rowCount. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
35
	 * @param int $colCount
0 ignored issues
show
Bug introduced by
There is no parameter named $colCount. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
36
	 * @return HtmlRating
37
	 */
38
	public function htmlRating($identifier, $value, $max, $icon="") {
39
		return $this->addHtmlComponent(new HtmlRating($identifier, $value, $max, $icon));
40
	}
41
42
	/**
43
	 *
44
	 * @param string $identifier
45
	 * @param int $value
46
	 * @param string $label
47
	 * @return HtmlProgress
48
	 */
49
	public function htmlProgress($identifier, $value=0, $label=NULL) {
50
		return $this->addHtmlComponent(new HtmlProgress($identifier, $value, $label));
51
	}
52
53
	/**
54
	 *
55
	 * @param string $identifier
56
	 * @param string $placeholder
57
	 * @return HtmlSearch
58
	 */
59
	public function htmlSearch($identifier, $placeholder=NULL, $icon=NULL) {
60
		return $this->addHtmlComponent(new HtmlSearch($identifier, $placeholder, $icon));
61
	}
62
63
	/**
64
	 *
65
	 * @param string $identifier
66
	 * @param mixed $content
67
	 * @return HtmlDimmer
68
	 */
69
	public function htmlDimmer($identifier, $content=NULL) {
70
		return $this->addHtmlComponent(new HtmlDimmer($identifier, $content));
71
	}
72
73
74
	/**
75
	 * @param string $identifier
76
	 * @param string $header
77
	 * @param string $content
78
	 * @param array $actions
79
	 * @return HtmlModal
80
	 */
81
	public function htmlModal($identifier, $header="", $content="", $actions=array()) {
82
		return $this->addHtmlComponent(new HtmlModal($identifier, $header,$content,$actions));
83
	}
84
85
	/**
86
	 * Returns a new Semantic Tab
87
	 * @see http://semantic-ui.com/modules/tab.html
88
	 * @param array $tabs
89
	 * @return HtmlTab
90
	 */
91
	public function htmlTab($identifier, $tabs=array()) {
92
		return $this->addHtmlComponent(new HtmlTab($identifier, $tabs));
93
	}
94
}