Completed
Push — master ( 3e8704...4367a8 )
by Jean-Christophe
03:21
created

HtmlDivider   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 55
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setVertical() 0 3 1
A setHorizontal() 0 3 1
A setHidden() 0 3 1
A setFitted() 0 3 1
A asHeader() 0 3 1
A setInverted() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\common\html\HtmlDoubleElement;
6
/**
7
 * Semantic UI divider component
8
 * @see http://semantic-ui.com/elements/divider.html
9
 * @author jc
10
 * @version 1.001
11
 */
12
class HtmlDivider extends HtmlDoubleElement {
13
14
	public function __construct($identifier, $content="",$tagName="div") {
15
		parent::__construct($identifier, $tagName);
16
		$this->setClass("ui divider");
17
		$this->content=$content;
18
	}
19
20
	/**
21
	 * vertical divider
22
	 * @return \Ajax\semantic\html\elements\HtmlDivider
23
	 */
24
	public function setVertical(){
25
		return $this->addToPropertyUnique("class", "vertical", array("vertical","horizontal"));
26
	}
27
28
	/**
29
	 * horizontal divider
30
	 * @return \Ajax\semantic\html\elements\HtmlDivider
31
	 */
32
	public function setHorizontal(){
33
		return $this->addToPropertyUnique("class", "horizontal", array("vertical","horizontal"));
34
	}
35
36
	/**
37
	 * hide the divider
38
	 * @return \Ajax\semantic\html\elements\HtmlDivider
39
	 */
40
	public function setHidden(){
41
		return $this->addToProperty("class", "hidden");
42
	}
43
44
	/**
45
	 * fitted, without any space above or below it
46
	 * @return \Ajax\semantic\html\elements\HtmlDivider
47
	 */
48
	public function setFitted(){
49
		return $this->addToProperty("class", "fitted");
50
	}
51
52
	/**
53
	 * @return \Ajax\semantic\html\elements\HtmlDivider
54
	 */
55
	public function asHeader(){
56
		return $this->addToProperty("class", "header");
57
	}
58
59
	/**
60
	 * inverts the divider colors
61
	 * @return \Ajax\semantic\html\elements\HtmlDivider
62
	 */
63
	public function setInverted(){
64
		return $this->addToProperty("class", "inverted");
65
	}
66
}