Completed
Push — master ( 409900...f20dfb )
by Jean-Christophe
03:24
created

HtmlContainer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setAlignement() 0 5 2
A setTextContainer() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
/**
7
 * Semantic UI container component
8
 * @see http://semantic-ui.com/elements/container.html#/definition
9
 * @author jc
10
 * @version 1.001
11
 */
12
class HtmlContainer extends HtmlSemDoubleElement {
13
14
	public function __construct($identifier, $content="") {
15
		parent::__construct($identifier, "div");
16
		$this->content=$content;
17
		$this->setProperty("class", "ui container");
18
	}
19
20
	public function setAlignement($value="justified"){
21
		if($value!=="justified")
22
			$value.=" aligned";
23
		return $this->addToProperty("class", $value);
24
	}
25
26
	public function setTextContainer(){
27
		return $this->addToProperty("class", "text");
28
	}
29
}