Completed
Push — master ( 0ba4b1...2affe6 )
by Jean-Christophe
03:09
created
Ajax/semantic/html/base/traits/TextAlignmentTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 	 * @param string $value
11 11
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
12 12
 	 */
13
-	public function setTextAlignment($value=TextAlignment::LEFT){
14
-		return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants());
13
+	public function setTextAlignment($value=TextAlignment::LEFT) {
14
+		return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants());
15 15
 	}
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlImage.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 		$this->setClass($this->_baseClass);
15 15
 	}
16 16
 
17
-	public function setCircular(){
17
+	public function setCircular() {
18 18
 		return $this->addToProperty("class", "circular");
19 19
 	}
20 20
 
21
-	public function asAvatar($caption=NULL){
22
-		if(isset($caption))
23
-			$this->wrap("",$caption);
21
+	public function asAvatar($caption=NULL) {
22
+		if (isset($caption))
23
+			$this->wrap("", $caption);
24 24
 		return $this->addToProperty("class", "avatar");
25 25
 	}
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	public function asAvatar($caption=NULL){
22
-		if(isset($caption))
23
-			$this->wrap("",$caption);
22
+		if(isset($caption)) {
23
+					$this->wrap("",$caption);
24
+		}
24 25
 		return $this->addToProperty("class", "avatar");
25 26
 	}
26 27
 }
27 28
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegmentGroups.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\HtmlSemCollection;
7 7
 use Ajax\semantic\html\base\constants\Sens;
8 8
 
9
-class HtmlSegmentGroups extends HtmlSemCollection{
9
+class HtmlSegmentGroups extends HtmlSemCollection {
10 10
 
11 11
 
12
-	public function __construct( $identifier, $items=array()){
13
-		parent::__construct( $identifier, "div","ui segments");
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, "div", "ui segments");
14 14
 		$this->addItems($items);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		return new HtmlSegment("segment-".$this->count(),$value);
18
+	protected function createItem($value) {
19
+		return new HtmlSegment("segment-".$this->count(), $value);
20 20
 	}
21 21
 
22 22
 	/**
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 	 * @param string $type one of "raised","stacked","piled" default : ""
25 25
 	 * @return \Ajax\semantic\html\elements\HtmlSegmentGroups
26 26
 	 */
27
-	public function setType($type){
27
+	public function setType($type) {
28 28
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
29 29
 	}
30 30
 
31
-	public function setSens($sens=Sens::VERTICAL){
31
+	public function setSens($sens=Sens::VERTICAL) {
32 32
 		return $this->addToPropertyCtrl("class", $sens, Sens::getConstants());
33 33
 	}
34 34
 
35
-	public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){
36
-		$group=new HtmlSegmentGroups($identifier,$items);
35
+	public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) {
36
+		$group=new HtmlSegmentGroups($identifier, $items);
37 37
 		$group->setSens($sens);
38 38
 		return $group->setType($type);
39 39
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIconGroups.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,21 +11,21 @@
 block discarded – undo
11 11
  */
12 12
 class HtmlIconGroups extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier,$size="") {
15
-		parent::__construct($identifier, "i","icons");
14
+	public function __construct($identifier, $size="") {
15
+		parent::__construct($identifier, "i", "icons");
16 16
 		$this->setSize($size);
17 17
 	}
18 18
 
19
-	public function add($icon,$size=""){
19
+	public function add($icon, $size="") {
20 20
 		$iconO=$icon;
21
-		if(\is_string($icon)){
21
+		if (\is_string($icon)) {
22 22
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
23 23
 			$iconO->setSize($size);
24 24
 		}
25 25
 		$this->addContent($iconO);
26 26
 	}
27 27
 
28
-	public function getIcon($index){
28
+	public function getIcon($index) {
29 29
 		return $this->content[$index];
30 30
 	}
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
  * @version 1.001
18 18
  */
19 19
 class HtmlSegment extends HtmlSemDoubleElement {
20
-	use AttachedTrait,TextAlignmentTrait;
20
+	use AttachedTrait, TextAlignmentTrait;
21 21
 	public function __construct($identifier, $content="") {
22
-		parent::__construct($identifier, "div","ui segment");
23
-		$this->_variations=\array_merge($this->_variations,[Variation::PADDED,Variation::COMPACT]);
24
-		$this->_states=\array_merge($this->_states,[State::LOADING]);
22
+		parent::__construct($identifier, "div", "ui segment");
23
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
24
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
25 25
 		$this->content=$content;
26 26
 	}
27 27
 
@@ -30,36 +30,36 @@  discard block
 block discarded – undo
30 30
 	 * @param string $type one of "raised","stacked","piled" default : ""
31 31
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
32 32
 	 */
33
-	public function setType($type){
33
+	public function setType($type) {
34 34
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
35 35
 	}
36 36
 
37
-	public function setSens($sens="vertical"){
38
-		return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal"));
37
+	public function setSens($sens="vertical") {
38
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
39 39
 	}
40 40
 
41 41
 
42
-	public function setEmphasis($value=Emphasis::SECONDARY){
42
+	public function setEmphasis($value=Emphasis::SECONDARY) {
43 43
 		return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants());
44 44
 	}
45 45
 
46
-	public function setCircular(){
46
+	public function setCircular() {
47 47
 		return $this->addToProperty("class", "circular");
48 48
 	}
49 49
 
50
-	public function clear(){
50
+	public function clear() {
51 51
 		return $this->addToProperty("class", "clearing");
52 52
 	}
53 53
 
54
-	public function setFloating($value="left"){
55
-		return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left"));
54
+	public function setFloating($value="left") {
55
+		return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left"));
56 56
 	}
57 57
 
58
-	public function setCompact(){
58
+	public function setCompact() {
59 59
 		return $this->addToProperty("class", "compact");
60 60
 	}
61 61
 
62
-	public function setBasic(){
62
+	public function setBasic() {
63 63
 		return $this->setProperty("class", "ui basic segment");
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,13 +10,16 @@
 block discarded – undo
10 10
 
11 11
 class HtmlLabel extends HtmlSemDoubleElement {
12 12
 	use LabeledIconTrait;
13
+
14
+	/**
15
+	 * @param string $identifier
16
+	 */
13 17
 	public function __construct($identifier,$caption="",$tagName="div") {
14 18
 		parent::__construct($identifier,$tagName,"ui label");
15 19
 		$this->content=$caption;
16 20
 	}
17 21
 
18 22
 	/**
19
-	 * @param string $side
20 23
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
21 24
 	 */
22 25
 	public function setPointing($value=Direction::NONE){
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlLabel extends HtmlSemDoubleElement {
12 12
 	use LabeledIconTrait;
13
-	public function __construct($identifier,$caption="",$tagName="div") {
14
-		parent::__construct($identifier,$tagName,"ui label");
13
+	public function __construct($identifier, $caption="", $tagName="div") {
14
+		parent::__construct($identifier, $tagName, "ui label");
15 15
 		$this->content=$caption;
16 16
 	}
17 17
 
@@ -19,33 +19,33 @@  discard block
 block discarded – undo
19 19
 	 * @param string $side
20 20
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
21 21
 	 */
22
-	public function setPointing($value=Direction::NONE){
23
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
22
+	public function setPointing($value=Direction::NONE) {
23
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
24 24
 	}
25 25
 
26 26
 	/**
27 27
 	 * @param string $side
28 28
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
29 29
 	 */
30
-	public function toCorner($side="left"){
31
-		return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner"));
30
+	public function toCorner($side="left") {
31
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
32 32
 	}
33 33
 
34 34
 	/**
35 35
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
36 36
 	 */
37
-	public function asTag(){
37
+	public function asTag() {
38 38
 		return $this->addToProperty("class", "tag");
39 39
 	}
40 40
 
41 41
 	/**
42 42
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
43 43
 	 */
44
-	public function asLink(){
44
+	public function asLink() {
45 45
 		return $this->setTagName("a");
46 46
 	}
47 47
 
48
-	public function setBasic(){
48
+	public function setBasic() {
49 49
 		return $this->addToProperty("class", "basic");
50 50
 	}
51 51
 
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
 	 * @param string $before
57 57
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
58 58
 	 */
59
-	public function addImage($src,$alt="",$before=true){
59
+	public function addImage($src, $alt="", $before=true) {
60 60
 		$this->addToProperty("class", "image");
61
-		return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before);
61
+		return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before);
62 62
 	}
63 63
 
64 64
 	/**
65 65
 	 * @param string $detail
66 66
 	 * @return \Ajax\common\html\HtmlDoubleElement
67 67
 	 */
68
-	public function addDetail($detail){
69
-		$div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName);
68
+	public function addDetail($detail) {
69
+		$div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName);
70 70
 		$div->setClass("detail");
71 71
 		$div->setContent($detail);
72 72
 		$this->addContent($div);
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlInput.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
 
8 8
 class HtmlInput extends HtmlSingleElement {
9 9
 
10
-	public function __construct($identifier,$type="text",$value="",$placeholder="") {
10
+	public function __construct($identifier, $type="text", $value="", $placeholder="") {
11 11
 		parent::__construct($identifier, "input");
12 12
 		$this->setProperty("name", $identifier);
13 13
 		$this->setProperty("value", $value);
14
-		if(JString::isNotNull($placeholder))
14
+		if (JString::isNotNull($placeholder))
15 15
 			$this->setProperty("placeholder", $placeholder);
16 16
 		$this->setProperty("type", $type);
17 17
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,9 @@
 block discarded – undo
11 11
 		parent::__construct($identifier, "input");
12 12
 		$this->setProperty("name", $identifier);
13 13
 		$this->setProperty("value", $value);
14
-		if(JString::isNotNull($placeholder))
15
-			$this->setProperty("placeholder", $placeholder);
14
+		if(JString::isNotNull($placeholder)) {
15
+					$this->setProperty("placeholder", $placeholder);
16
+		}
16 17
 		$this->setProperty("type", $type);
17 18
 	}
18 19
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlInput.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\constants\State;
7 7
 use Ajax\semantic\html\base\constants\Direction;
8 8
 
9
-class HtmlInput extends HtmlSemDoubleElement{
9
+class HtmlInput extends HtmlSemDoubleElement {
10 10
 	private $_hasIcon=false;
11 11
 
12
-	public function __construct($identifier,$type="text",$value="",$placeholder=""){
13
-		parent::__construct("div-".$identifier,"div","ui input");
14
-		$this->content=new \Ajax\common\html\html5\HtmlInput($identifier,$type,$value,$placeholder);
15
-		$this->_states=[State::DISABLED,State::FOCUS,State::ERROR,State::LOADING];
12
+	public function __construct($identifier, $type="text", $value="", $placeholder="") {
13
+		parent::__construct("div-".$identifier, "div", "ui input");
14
+		$this->content=new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder);
15
+		$this->_states=[State::DISABLED, State::FOCUS, State::ERROR, State::LOADING];
16 16
 		$this->_variations=[];
17 17
 	}
18 18
 
19
-	public function setFocus(){
19
+	public function setFocus() {
20 20
 		$this->addToProperty("class", State::FOCUS);
21 21
 	}
22 22
 
23
-	public function addIcon($icon,$direction=Direction::LEFT){
24
-		if($this->_hasIcon===false){
23
+	public function addIcon($icon, $direction=Direction::LEFT) {
24
+		if ($this->_hasIcon===false) {
25 25
 			$iconO=$icon;
26
-			if(\is_string($icon)){
26
+			if (\is_string($icon)) {
27 27
 				$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
28 28
 			}
29 29
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
30
-			$this->addContent($iconO,false);
30
+			$this->addContent($iconO, false);
31 31
 			$this->_hasIcon=true;
32
-		}else{
32
+		}else {
33 33
 			$iconO=$this->getIcon();
34 34
 			$iconO->setIcon($icon);
35 35
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
@@ -37,49 +37,49 @@  discard block
 block discarded – undo
37 37
 		return $iconO;
38 38
 	}
39 39
 
40
-	public function getIcon(){
41
-		if(\is_array($this->content)){
42
-			foreach ($this->content as $item){
43
-				if($item instanceof HtmlIcon)
40
+	public function getIcon() {
41
+		if (\is_array($this->content)) {
42
+			foreach ($this->content as $item) {
43
+				if ($item instanceof HtmlIcon)
44 44
 					return $item;
45 45
 			}
46 46
 		}
47 47
 	}
48 48
 
49
-	public function addLoading(){
50
-		if($this->_hasIcon===false){
49
+	public function addLoading() {
50
+		if ($this->_hasIcon===false) {
51 51
 			throw new \Exception("Input must have an icon for showing a loader, use addIcon before");
52 52
 		}
53 53
 		return $this->addToProperty("class", State::LOADING);
54 54
 	}
55 55
 
56
-	public function addLabel($label,$direction=Direction::LEFT,$icon=NULL){
56
+	public function addLabel($label, $direction=Direction::LEFT, $icon=NULL) {
57 57
 		$labelO=$label;
58
-		if(\is_object($label)===false){
59
-			$labelO=new HtmlLabel("label-".$this->identifier,$label);
60
-			if(isset($icon))
58
+		if (\is_object($label)===false) {
59
+			$labelO=new HtmlLabel("label-".$this->identifier, $label);
60
+			if (isset($icon))
61 61
 				$labelO->addIcon($icon);
62
-		}else{
62
+		}else {
63 63
 			$labelO->addToPropertyCtrl("class", "label", array("label"));
64 64
 		}
65 65
 		$this->addToProperty("class", $direction." labeled");
66
-		$this->addContent($labelO,\strstr($direction,Direction::LEFT)!==false);
66
+		$this->addContent($labelO, \strstr($direction, Direction::LEFT)!==false);
67 67
 		return $labelO;
68 68
 	}
69 69
 
70
-	public function addLabelToCorner($label,$direction=Direction::LEFT,$icon=NULL){
71
-		return $this->addLabel($label,$direction." corner",$icon)->toCorner($direction);
70
+	public function addLabelToCorner($label, $direction=Direction::LEFT, $icon=NULL) {
71
+		return $this->addLabel($label, $direction." corner", $icon)->toCorner($direction);
72 72
 	}
73 73
 
74
-	public function addAction($action,$direction=Direction::LEFT,$icon=NULL,$labeled=false){
74
+	public function addAction($action, $direction=Direction::LEFT, $icon=NULL, $labeled=false) {
75 75
 		$actionO=$action;
76
-		if(\is_object($action)===false){
77
-			$actionO=new HtmlButton("action-".$this->identifier,$action);
78
-			if(isset($icon))
79
-				$actionO->addIcon($icon,true,$labeled);
76
+		if (\is_object($action)===false) {
77
+			$actionO=new HtmlButton("action-".$this->identifier, $action);
78
+			if (isset($icon))
79
+				$actionO->addIcon($icon, true, $labeled);
80 80
 		}
81 81
 		$this->addToProperty("class", $direction." action");
82
-		$this->addContent($actionO,\strstr($direction,Direction::LEFT)!==false);
82
+		$this->addContent($actionO, \strstr($direction, Direction::LEFT)!==false);
83 83
 		return $actionO;
84 84
 	}
85 85
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
30 30
 			$this->addContent($iconO,false);
31 31
 			$this->_hasIcon=true;
32
-		}else{
32
+		} else{
33 33
 			$iconO=$this->getIcon();
34 34
 			$iconO->setIcon($icon);
35 35
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
 	public function getIcon(){
41 41
 		if(\is_array($this->content)){
42 42
 			foreach ($this->content as $item){
43
-				if($item instanceof HtmlIcon)
44
-					return $item;
43
+				if($item instanceof HtmlIcon) {
44
+									return $item;
45
+				}
45 46
 			}
46 47
 		}
47 48
 	}
@@ -57,9 +58,10 @@  discard block
 block discarded – undo
57 58
 		$labelO=$label;
58 59
 		if(\is_object($label)===false){
59 60
 			$labelO=new HtmlLabel("label-".$this->identifier,$label);
60
-			if(isset($icon))
61
-				$labelO->addIcon($icon);
62
-		}else{
61
+			if(isset($icon)) {
62
+							$labelO->addIcon($icon);
63
+			}
64
+		} else{
63 65
 			$labelO->addToPropertyCtrl("class", "label", array("label"));
64 66
 		}
65 67
 		$this->addToProperty("class", $direction." labeled");
@@ -75,8 +77,9 @@  discard block
 block discarded – undo
75 77
 		$actionO=$action;
76 78
 		if(\is_object($action)===false){
77 79
 			$actionO=new HtmlButton("action-".$this->identifier,$action);
78
-			if(isset($icon))
79
-				$actionO->addIcon($icon,true,$labeled);
80
+			if(isset($icon)) {
81
+							$actionO->addIcon($icon,true,$labeled);
82
+			}
80 83
 		}
81 84
 		$this->addToProperty("class", $direction." action");
82 85
 		$this->addContent($actionO,\strstr($direction,Direction::LEFT)!==false);
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/State.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 abstract class State extends BaseEnum {
8
-	const ACTIVE="active",DISABLED="disabled",ERROR="error",FOCUS="focus",LOADING="loading";
8
+	const ACTIVE="active", DISABLED="disabled", ERROR="error", FOCUS="focus", LOADING="loading";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.