SemanticHtmlModulesTrait::htmlDimmer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
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
14
trait SemanticHtmlModulesTrait {
15
16
	public abstract function addHtmlComponent($htmlComponent);
17
18
	/**
19
	 * Module checkbox
20
	 * @param string $identifier
21
	 * @param string $label
22
	 * @param mixed $value
23
	 * @param CheckboxType $type
24
	 * @return HtmlCheckbox
25
	 */
26
	public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
27
		return $this->addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type));
28
	}
29
30
	/**
31
	 *
32
	 * @param string $identifier
33
	 * @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...
34
	 * @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...
35
	 * @return HtmlRating
36
	 */
37
	public function htmlRating($identifier, $value, $max, $icon="") {
38
		return $this->addHtmlComponent(new HtmlRating($identifier, $value, $max, $icon));
39
	}
40
41
	/**
42
	 *
43
	 * @param string $identifier
44
	 * @param int $value
45
	 * @param string $label
46
	 * @return HtmlProgress
47
	 */
48
	public function htmlProgress($identifier, $value=0, $label=NULL) {
49
		return $this->addHtmlComponent(new HtmlProgress($identifier, $value, $label));
50
	}
51
52
	/**
53
	 *
54
	 * @param string $identifier
55
	 * @param string $placeholder
56
	 * @return HtmlSearch
57
	 */
58
	public function htmlSearch($identifier, $placeholder=NULL, $icon=NULL) {
59
		return $this->addHtmlComponent(new HtmlSearch($identifier, $placeholder, $icon));
60
	}
61
62
	/**
63
	 *
64
	 * @param string $identifier
65
	 * @param mixed $content
66
	 * @return HtmlDimmer
67
	 */
68
	public function htmlDimmer($identifier, $content=NULL) {
69
		return $this->addHtmlComponent(new HtmlDimmer($identifier, $content));
70
	}
71
72
73
	/**
74
	 * @param string $identifier
75
	 * @param string $header
76
	 * @param string $content
77
	 * @param array $actions
78
	 * @return HtmlModal
79
	 */
80
	public function htmlModal($identifier, $header="", $content="", $actions=array()) {
81
		return $this->addHtmlComponent(new HtmlModal($identifier, $header,$content,$actions));
82
	}
83
}