Passed
Push — master ( ef609f...421c61 )
by Jean-Christophe
02:48
created

SemanticHtmlElementsTrait::htmlLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 4
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ajax\semantic\traits;
4
5
use Ajax\semantic\html\elements\HtmlButtonGroups;
6
use Ajax\semantic\html\elements\HtmlButton;
7
use Ajax\semantic\html\elements\HtmlContainer;
8
use Ajax\semantic\html\elements\HtmlDivider;
9
use Ajax\semantic\html\elements\HtmlHeader;
10
use Ajax\semantic\html\elements\HtmlIcon;
11
use Ajax\semantic\html\elements\HtmlIconGroups;
12
use Ajax\semantic\html\elements\HtmlInput;
13
use Ajax\semantic\html\elements\HtmlLabel;
14
use Ajax\semantic\html\elements\HtmlList;
15
use Ajax\semantic\html\elements\HtmlSegment;
16
use Ajax\semantic\html\elements\HtmlSegmentGroups;
17
use Ajax\semantic\html\elements\HtmlReveal;
18
use Ajax\semantic\html\base\constants\RevealType;
19
use Ajax\semantic\html\base\constants\Direction;
20
use Ajax\semantic\html\elements\HtmlStep;
21
use Ajax\semantic\html\elements\HtmlFlag;
22
use Ajax\semantic\html\elements\HtmlImage;
23
use Ajax\semantic\html\base\constants\State;
24
use Ajax\semantic\html\elements\HtmlLabelGroups;
25
use Ajax\common\html\BaseHtml;
26
27
trait SemanticHtmlElementsTrait {
28
29
	abstract public function addHtmlComponent(BaseHtml $htmlComponent);
30
31
	public function addState($state, $elements) {
32
		State::add($state, $elements);
33
	}
34
35
	/**
36
	 * Return a new Semantic Html Button
37
	 * @see http://phpmv-ui.kobject.net/index/direct/main/31
38
	 * @see http://semantic-ui.com/elements/button.html
39
	 * @param string $identifier
40
	 * @param string $value
41
	 * @param string $cssStyle
42
	 * @param string $onClick
43
	 * @return HtmlButton
44
	 */
45
	public function htmlButton($identifier, $value=null, $cssStyle=null, $onClick=null) {
46
		return $this->addHtmlComponent(new HtmlButton($identifier, $value, $cssStyle, $onClick));
47
	}
48
49
	/**
50
	 * Returns a group of Semantic buttons
51
	 * @see http://phpmv-ui.kobject.net/index/direct/main/50
52
	 * @see http://semantic-ui.com/elements/button.html#buttons
53
	 * @param string $identifier
54
	 * @param array $elements
55
	 * @param boolean $asIcons
56
	 * @return HtmlButtonGroups
57
	 */
58
	public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) {
59
		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons));
60
	}
61
62
	/**
63
	 * Returns a new Semantic container
64
	 * @see http://phpmv-ui.kobject.net/index/direct/main/34
65
	 * @see http://semantic-ui.com/elements/container.html
66
	 * @param string $identifier
67
	 * @param string $content
68
	 * @return HtmlContainer
69
	 */
70
	public function htmlContainer($identifier, $content="") {
71
		return $this->addHtmlComponent(new HtmlContainer($identifier, $content));
72
	}
73
74
	/**
75
	 * Returns a new Semantic divider
76
	 * @see http://phpmv-ui.kobject.net/index/direct/main/42
77
	 * @see http://semantic-ui.com/elements/divider.html
78
	 * @param string $identifier
79
	 * @param string $content
80
	 * @return HtmlDivider
81
	 */
82
	public function htmlDivider($identifier, $content="", $tagName="div") {
83
		return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName));
84
	}
85
86
	/**
87
	 * Returns a new Semantic header
88
	 * @see http://phpmv-ui.kobject.net/index/direct/main/43
89
	 * @see http://semantic-ui.com/elements/header.html
90
	 * @param string $identifier
91
	 * @param number $niveau
92
	 * @param mixed $content
93
	 * @param string $type
94
	 * @return HtmlHeader
95
	 */
96
	public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") {
97
		return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type));
98
	}
99
100
	/**
101
	 * Returns a new Semantic icon
102
	 * @see http://phpmv-ui.kobject.net/index/direct/main/44
103
	 * @see http://semantic-ui.com/elements/icon.html
104
	 * @param string $identifier
105
	 * @param string $icon
106
	 * @return HtmlIcon
107
	 */
108
	public function htmlIcon($identifier, $icon) {
109
		return $this->addHtmlComponent(new HtmlIcon($identifier, $icon));
110
	}
111
112
	/**
113
	 * Returns a new Semantic image
114
	 * @see http://phpmv-ui.kobject.net/index/direct/main/55
115
	 * @see http://semantic-ui.com/elements/image.html
116
	 * @param string $identifier
117
	 * @param string $src
118
	 * @param string $alt
119
	 * @param string $size
120
	 * @return HtmlImage
121
	 */
122
	public function htmlImage($identifier, $src="", $alt="", $size=NULL) {
123
		return $this->addHtmlComponent(new HtmlImage($identifier, $src, $alt, $size));
124
	}
125
126
	/**
127
	 * Returns a new Semantic group of images
128
	 * @see http://phpmv-ui.kobject.net/index/direct/main/0
129
	 * @see http://semantic-ui.com/elements/image.html#size
130
	 * @param string $identifier
131
	 * @param array $icons
132
	 * @param string $size
133
	 * @return HtmlIconGroups
134
	 */
135
	public function htmlIconGroups($identifier, $icons=array(), $size="") {
136
		return $this->addHtmlComponent(new HtmlIconGroups($identifier, $icons, $size));
137
	}
138
139
	/**
140
	 * Returns a new Semantic html input
141
	 * @see http://phpmv-ui.kobject.net/index/direct/main/45
142
	 * @see http://semantic-ui.com/elements/input.html
143
	 * @param string $identifier
144
	 * @param string $type
145
	 * @param string $value
146
	 * @param string $placeholder
147
	 * @return HtmlInput
148
	 */
149
	public function htmlInput($identifier, $type="text", $value="", $placeholder="") {
150
		return $this->addHtmlComponent(new HtmlInput($identifier, $type, $value, $placeholder));
151
	}
152
153
	/**
154
	 * Returns a new Semantic label
155
	 * @see http://phpmv-ui.kobject.net/index/direct/main/46
156
	 * @see http://semantic-ui.com/elements/label.html
157
	 * @param string $identifier
158
	 * @param string $content
159
	 * @param string $tagName
160
	 * @return HtmlLabel
161
	 */
162
	public function htmlLabel($identifier, $content="", $icon=NULL,$tagName="div") {
163
		return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$icon, $tagName));
164
	}
165
166
	/**
167
	 * @param string $identifier
168
	 * @param array $labels
169
	 * @param array $attributes
170
	 * @return HtmlLabelGroups
171
	 */
172
	public function htmlLabelGroups($identifier,$labels=array(),$attributes=array()){
173
		return $this->addHtmlComponent(new HtmlLabelGroups($identifier,$labels,$attributes));
174
	}
175
176
	/**
177
	 *
178
	 * @param string $identifier
179
	 * @param array $items
180
	 * @return HtmlList
181
	 */
182
	public function htmlList($identifier, $items=array()) {
183
		return $this->addHtmlComponent(new HtmlList($identifier, $items));
184
	}
185
186
	/**
187
	 * Adds a new segment, used to create a grouping of related content
188
	 * @param string $identifier
189
	 * @param string $content
190
	 * @return HtmlSegment
191
	 */
192
	public function htmlSegment($identifier, $content="") {
193
		return $this->addHtmlComponent(new HtmlSegment($identifier, $content));
194
	}
195
196
	/**
197
	 * Adds a group of segments
198
	 * @param string $identifier
199
	 * @param array $items the segments
200
	 * @return HtmlSegmentGroups
201
	 */
202
	public function htmlSegmentGroups($identifier, $items=array()) {
203
		return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items));
204
	}
205
206
	/**
207
	 *
208
	 * @param string $identifier
209
	 * @param string|HtmlSemDoubleElement $visibleContent
0 ignored issues
show
Bug introduced by
The type Ajax\semantic\traits\HtmlSemDoubleElement was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
210
	 * @param string|HtmlSemDoubleElement $hiddenContent
211
	 * @param RevealType|string $type
212
	 * @param Direction|string $attributeType
213
	 * @return HtmlReveal
214
	 */
215
	public function htmlReveal($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) {
216
		return $this->addHtmlComponent(new HtmlReveal($identifier, $visibleContent, $hiddenContent, $type, $attributeType));
217
	}
218
219
	/**
220
	 * @param string $identifier
221
	 * @param array $steps
222
	 * @return HtmlStep
223
	 */
224
	public function htmlStep($identifier, $steps=array()) {
225
		return $this->addHtmlComponent(new HtmlStep($identifier, $steps));
226
	}
227
228
	/**
229
	 * @param string $identifier
230
	 * @param string $flag
231
	 * @return HtmlFlag
232
	 */
233
	public function htmlFlag($identifier, $flag) {
234
		return $this->addHtmlComponent(new HtmlFlag($identifier, $flag));
235
	}
236
}
237