Passed
Push — master ( 346e2d...016005 )
by Jean-Christophe
02:05
created
Ajax/semantic/html/views/HtmlItems.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@
 block discarded – undo
9 9
 class HtmlItems extends HtmlViewGroups {
10 10
 
11 11
 	public function __construct($identifier, $items=[]) {
12
-		parent::__construct($identifier, "ui items",$items);
12
+		parent::__construct($identifier, "ui items", $items);
13 13
 	}
14 14
 
15
-	protected function createElement(){
16
-		return new HtmlItem("item-" . $this->count());
15
+	protected function createElement() {
16
+		return new HtmlItem("item-".$this->count());
17 17
 	}
18 18
 
19 19
 	public function newItem($identifier) {
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/ContentPartTrait.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,24 +6,24 @@
 block discarded – undo
6 6
  * @author jc
7 7
  * @property mixed $content
8 8
  */
9
-trait ContentPartTrait{
10
-	public function addElementInPart($element,$partKey,$before=false,$force=false){
11
-		$part=$this->getPart($partKey,null,$force);
12
-		if($part instanceof  HtmlSemDoubleElement){
9
+trait ContentPartTrait {
10
+	public function addElementInPart($element, $partKey, $before=false, $force=false) {
11
+		$part=$this->getPart($partKey, null, $force);
12
+		if ($part instanceof  HtmlSemDoubleElement) {
13 13
 			$this->content[$partKey]=$part;
14
-			$part->addContent($element,$before);
14
+			$part->addContent($element, $before);
15 15
 		}
16 16
 		return $this;
17 17
 	}
18 18
 
19
-	public function getPart($partKey, $index=NULL,$force=false) {
19
+	public function getPart($partKey, $index=NULL, $force=false) {
20 20
 		if (\array_key_exists($partKey, $this->content)) {
21 21
 			if (isset($index))
22 22
 				return $this->content[$partKey][$index];
23 23
 			return $this->content[$partKey];
24 24
 		}
25
-		if($force){
26
-			return new HtmlSemDoubleElement($partKey."-".$this->identifier,"div",$partKey);
25
+		if ($force) {
26
+			return new HtmlSemDoubleElement($partKey."-".$this->identifier, "div", $partKey);
27 27
 		}
28 28
 		return NULL;
29 29
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@
 block discarded – undo
18 18
 
19 19
 	public function getPart($partKey, $index=NULL,$force=false) {
20 20
 		if (\array_key_exists($partKey, $this->content)) {
21
-			if (isset($index))
22
-				return $this->content[$partKey][$index];
21
+			if (isset($index)) {
22
+							return $this->content[$partKey][$index];
23
+			}
23 24
 			return $this->content[$partKey];
24 25
 		}
25 26
 		if($force){
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/HtmlViewItem.php 2 patches
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
 	public function __construct($identifier,$baseClass,$content=NULL) {
20 20
 		parent::__construct($identifier, "div", $baseClass);
21 21
 		$this->content=["content"=>new HtmlViewContent("content-".$this->identifier)];
22
-		if(isset($content))
23
-			$this->setContent($content);
22
+		if(isset($content)) {
23
+					$this->setContent($content);
24
+		}
24 25
 	}
25 26
 
26 27
 	public function setContent($value){
@@ -31,10 +32,12 @@  discard block
 block discarded – undo
31 32
 			if (isset($image)) {
32 33
 				$this->addImage($image);
33 34
 			}
34
-			if(isset($content))
35
-				$this->content["content"]->setContent($content);
36
-			if(isset($extra))
37
-				$this->addExtraContent($extra);
35
+			if(isset($content)) {
36
+							$this->content["content"]->setContent($content);
37
+			}
38
+			if(isset($extra)) {
39
+							$this->addExtraContent($extra);
40
+			}
38 41
 		}
39 42
 	}
40 43
 
@@ -49,10 +52,11 @@  discard block
 block discarded – undo
49 52
 		if (\array_key_exists($key, $this->content) === false) {
50 53
 			$this->content[$key]=[];
51 54
 		}
52
-		if($this->content[$key] instanceof HtmlViewContent)
53
-			$this->content[$key]->addElement($element);
54
-		else
55
-			$this->content[$key][]=$element;
55
+		if($this->content[$key] instanceof HtmlViewContent) {
56
+					$this->content[$key]->addElement($element);
57
+		} else {
58
+					$this->content[$key][]=$element;
59
+		}
56 60
 		return $element;
57 61
 	}
58 62
 
@@ -153,8 +157,9 @@  discard block
 block discarded – undo
153 157
 		$this->addToProperty("class", "link");
154 158
 		if ($href !== "") {
155 159
 			$this->setProperty("href", $href);
156
-			if (isset($target))
157
-				$this->setProperty("target", $target);
160
+			if (isset($target)) {
161
+							$this->setProperty("target", $target);
162
+			}
158 163
 		}
159 164
 		return $this;
160 165
 	}
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 abstract class HtmlViewItem extends HtmlSemDoubleElement {
17 17
 	use ContentPartTrait;
18 18
 
19
-	public function __construct($identifier,$baseClass,$content=NULL) {
19
+	public function __construct($identifier, $baseClass, $content=NULL) {
20 20
 		parent::__construct($identifier, "div", $baseClass);
21 21
 		$this->content=["content"=>new HtmlViewContent("content-".$this->identifier)];
22
-		if(isset($content))
22
+		if (isset($content))
23 23
 			$this->setContent($content);
24 24
 	}
25 25
 
26
-	public function setContent($value){
26
+	public function setContent($value) {
27 27
 		if (\is_array($value)) {
28 28
 			$image=JArray::getValue($value, "image", 0);
29 29
 			$content=JArray::getValue($value, "content", 1);
@@ -31,57 +31,57 @@  discard block
 block discarded – undo
31 31
 			if (isset($image)) {
32 32
 				$this->addImage($image);
33 33
 			}
34
-			if(isset($content))
34
+			if (isset($content))
35 35
 				$this->content["content"]->setContent($content);
36
-			if(isset($extra))
36
+			if (isset($extra))
37 37
 				$this->addExtraContent($extra);
38 38
 		}
39 39
 	}
40 40
 
41 41
 	private function createContent($content, $baseClass="content") {
42 42
 		$count=\sizeof($this->content);
43
-		$result=new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content);
43
+		$result=new HtmlViewContent("content-".$count."-".$this->identifier, $content);
44 44
 		$result->setClass($baseClass);
45 45
 		return $result;
46 46
 	}
47 47
 
48 48
 	private function addElementIn($key, $element) {
49
-		if (\array_key_exists($key, $this->content) === false) {
49
+		if (\array_key_exists($key, $this->content)===false) {
50 50
 			$this->content[$key]=[];
51 51
 		}
52
-		if($this->content[$key] instanceof HtmlViewContent)
52
+		if ($this->content[$key] instanceof HtmlViewContent)
53 53
 			$this->content[$key]->addElement($element);
54 54
 		else
55 55
 			$this->content[$key][]=$element;
56 56
 		return $element;
57 57
 	}
58 58
 
59
-	public function addIcon($icon,$before=true){
60
-		return $this->addElementIn("icon",new HtmlIcon("icon-" . $this->identifier, $icon));
59
+	public function addIcon($icon, $before=true) {
60
+		return $this->addElementIn("icon", new HtmlIcon("icon-".$this->identifier, $icon));
61 61
 	}
62 62
 
63 63
 
64 64
 	public function addHeader($header, $niveau=4, $type="page") {
65 65
 		if (!$header instanceof HtmlHeader) {
66
-			$header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type);
66
+			$header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type);
67 67
 		}
68
-		return $this->addElementIn("header",$this->createContent($header));
68
+		return $this->addElementIn("header", $this->createContent($header));
69 69
 	}
70 70
 
71 71
 	public function addImage($image, $title="") {
72 72
 		if (!$image instanceof HtmlImage) {
73
-			$image=new HtmlImage("image-" . $this->identifier, $image, $title);
73
+			$image=new HtmlImage("image-".$this->identifier, $image, $title);
74 74
 		}
75 75
 		$image->setClass("ui image");
76
-		return $this->content["image"]= $image;
76
+		return $this->content["image"]=$image;
77 77
 	}
78 78
 
79
-	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL,$key="extra-content") {
79
+	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL, $key="extra-content") {
80 80
 		$reveal=$visibleContent;
81 81
 		if (!$visibleContent instanceof HtmlReveal) {
82
-			$reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
82
+			$reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
83 83
 		}
84
-		return $this->content[$key]= $reveal;
84
+		return $this->content[$key]=$reveal;
85 85
 	}
86 86
 
87 87
 	public function addRevealImage($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) {
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 		if (!$visibleContent instanceof HtmlReveal) {
90 90
 			return $this->addReveal(new HtmlImage("", $visibleContent), new HtmlImage("", $hiddenContent), $type, $attributeType);
91 91
 		}
92
-		return $this->content["image"]= $reveal;
92
+		return $this->content["image"]=$reveal;
93 93
 	}
94 94
 
95 95
 	public function addExtraContent($content=array()) {
96
-		return $this->content["extra-content"]= $this->createContent($content, "extra content");
96
+		return $this->content["extra-content"]=$this->createContent($content, "extra content");
97 97
 	}
98 98
 
99 99
 	/**
@@ -103,23 +103,23 @@  discard block
 block discarded – undo
103 103
 	 * @param boolean $before
104 104
 	 * @return HtmlButtonGroups
105 105
 	 */
106
-	public function addContentButtons($elements=array(), $asIcons=false,$part="extra",$before=false){
107
-		return $this->content["content"]->addContentButtons($elements,$asIcons,$part, $before);
106
+	public function addContentButtons($elements=array(), $asIcons=false, $part="extra", $before=false) {
107
+		return $this->content["content"]->addContentButtons($elements, $asIcons, $part, $before);
108 108
 	}
109 109
 
110 110
 
111 111
 
112
-	public function addItemHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) {
113
-		return $this->content["content"]->addHeaderContent($header, $metas, $description,$extra);
112
+	public function addItemHeaderContent($header, $metas=array(), $description=NULL, $extra=NULL) {
113
+		return $this->content["content"]->addHeaderContent($header, $metas, $description, $extra);
114 114
 	}
115 115
 
116 116
 	public function addItemContent($content=array()) {
117 117
 		$count=\sizeof($this->content);
118
-		return $this->addElementIn("content", new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content));
118
+		return $this->addElementIn("content", new HtmlViewContent("content-".$count."-".$this->identifier, $content));
119 119
 	}
120 120
 
121 121
 	public function getItemContent() {
122
-		return $this->getPart("content",null,true);
122
+		return $this->getPart("content", null, true);
123 123
 	}
124 124
 
125 125
 	public function getItemExtraContent() {
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 	 * @see HtmlSemDoubleElement::compile()
142 142
 	 */
143 143
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
144
-		$this->content=JArray::sortAssociative($this->content, ["header","image","icon","content","extra-content"]);
144
+		$this->content=JArray::sortAssociative($this->content, ["header", "image", "icon", "content", "extra-content"]);
145 145
 		return parent::compile($js, $view);
146 146
 	}
147 147
 
148
-	public function asLink($href="",$target=NULL) {
148
+	public function asLink($href="", $target=NULL) {
149 149
 		$this->addToProperty("class", "link");
150
-		if ($href !== "") {
150
+		if ($href!=="") {
151 151
 			$this->setProperty("href", $href);
152 152
 			if (isset($target))
153 153
 				$this->setProperty("target", $target);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,12 +99,12 @@
 block discarded – undo
99 99
 	}
100 100
 
101 101
 	/**
102
-	*  Adds an image
103
-	* @param string $src
104
-	* @param string $alt
105
-	* @param boolean $before
106
-	* @return HtmlImg
107
-	*/
102
+	 *  Adds an image
103
+	 * @param string $src
104
+	 * @param string $alt
105
+	 * @param boolean $before
106
+	 * @return HtmlImg
107
+	 */
108 108
 	public function addImage($src, $alt="", $before=true) {
109 109
 		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
110 110
 		$img->setClass("");
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * @version 1.001
19 19
  */
20 20
 class HtmlLabel extends HtmlSemDoubleElement {
21
-	use LabeledIconTrait,HasTimeoutTrait;
21
+	use LabeledIconTrait, HasTimeoutTrait;
22 22
 
23 23
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
24 24
 		parent::__construct($identifier, $tagName, "ui label");
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	 * @return HtmlLabel
34 34
 	 */
35 35
 	public function setPointing($value=Direction::NONE) {
36
-		if($value==="left" || $value==="right")
36
+		if ($value==="left" || $value==="right")
37 37
 			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
38 38
 		else
39
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
39
+			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing", true));
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 	 * @return HtmlLabel
46 46
 	 */
47 47
 	public function toCorner($side="left") {
48
-		return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" ));
48
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
49 49
 	}
50 50
 
51
-	public function setHorizontal(){
52
-		return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal"));
51
+	public function setHorizontal() {
52
+		return $this->addToPropertyCtrl("class", "hozizontal", array("horizontal"));
53 53
 	}
54 54
 
55
-	public function setFloating(){
56
-		return $this->addToPropertyCtrl("class", "floating",array("floating"));
55
+	public function setFloating() {
56
+		return $this->addToPropertyCtrl("class", "floating", array("floating"));
57 57
 	}
58 58
 
59 59
 	/**
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 		return $this->addToProperty("class", "tag");
65 65
 	}
66 66
 
67
-	public function setEmpty(){
67
+	public function setEmpty() {
68 68
 		$this->content=NULL;
69
-		return $this->addToPropertyCtrl("class", "empty",array("empty"));
69
+		return $this->addToPropertyCtrl("class", "empty", array("empty"));
70 70
 	}
71 71
 
72 72
 	public function setBasic() {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function addEmphasisImage($src, $alt="", $before=true) {
84 84
 		$this->addToProperty("class", "image");
85
-		return $this->addImage($src,$alt,$before);
85
+		return $this->addImage($src, $alt, $before);
86 86
 	}
87 87
 
88 88
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @return HtmlImg
94 94
 	 */
95 95
 	public function addAvatarImage($src, $alt="", $before=true) {
96
-		$img=$this->addImage($src,$alt,$before);
96
+		$img=$this->addImage($src, $alt, $before);
97 97
 		$img->setClass("ui image");
98 98
 		$img->asAvatar();
99 99
 		return $img;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	* @return HtmlImg
108 108
 	*/
109 109
 	public function addImage($src, $alt="", $before=true) {
110
-		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
110
+		$img=new HtmlImg("image-".$this->identifier, $src, $alt);
111 111
 		$img->setClass("");
112 112
 		$this->addContent($img, $before);
113 113
 		return $img;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * @return HtmlDoubleElement
120 120
 	 */
121 121
 	public function addDetail($detail) {
122
-		$div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail");
122
+		$div=new HtmlSemDoubleElement("detail-".$this->identifier, $this->tagName, "detail");
123 123
 		$div->setContent($detail);
124 124
 		$this->addContent($div);
125 125
 		return $div;
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 	 * @return HtmlLabel
131 131
 	 */
132 132
 	public function asRibbon($direction=Direction::NONE) {
133
-		return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" ));
133
+		return $this->addToPropertyCtrl("class", $direction." ribbon", array("ribbon", "right ribbon", "left ribbon"));
134 134
 	}
135 135
 
136
-	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
137
-		if($direction!==Direction::NONE)
138
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
136
+	public function setAttached($side=Side::TOP, $direction=Direction::NONE) {
137
+		if ($direction!==Direction::NONE)
138
+			return $this->addToPropertyCtrl("class", $side." ".$direction." attached", Side::getConstantValues($direction." attached"));
139 139
 		else
140
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
140
+			return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
141 141
 	}
142 142
 
143 143
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @param string $direction one of RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE="",BELOW="below"
147 147
 	 * @return HtmlLabel
148 148
 	 */
149
-	public static function ribbon($identifier, $caption,$direction=Direction::NONE) {
149
+	public static function ribbon($identifier, $caption, $direction=Direction::NONE) {
150 150
 		return (new HtmlLabel($identifier, $caption))->asRibbon($direction);
151 151
 	}
152 152
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
24 24
 		parent::__construct($identifier, $tagName, "ui label");
25 25
 		$this->content=$caption;
26
-		if (isset($icon))
27
-			$this->addIcon($icon);
26
+		if (isset($icon)) {
27
+					$this->addIcon($icon);
28
+		}
28 29
 	}
29 30
 
30 31
 	/**
@@ -33,10 +34,11 @@  discard block
 block discarded – undo
33 34
 	 * @return HtmlLabel
34 35
 	 */
35 36
 	public function setPointing($value=Direction::NONE) {
36
-		if($value==="left" || $value==="right")
37
-			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
38
-		else
39
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
37
+		if($value==="left" || $value==="right") {
38
+					return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
39
+		} else {
40
+					return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
41
+		}
40 42
 	}
41 43
 
42 44
 	/**
@@ -134,10 +136,11 @@  discard block
 block discarded – undo
134 136
 	}
135 137
 
136 138
 	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
137
-		if($direction!==Direction::NONE)
138
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
139
-		else
140
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
139
+		if($direction!==Direction::NONE) {
140
+					return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
141
+		} else {
142
+					return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
143
+		}
141 144
 	}
142 145
 
143 146
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabelGroups.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class HtmlLabelGroups extends HtmlSemCollection {
17 17
 
18
-	public function __construct($identifier,$labels=array(), $attributes=array()) {
18
+	public function __construct($identifier, $labels=array(), $attributes=array()) {
19 19
 		parent::__construct($identifier, "div", "ui labels");
20
-		$this->_states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]);
20
+		$this->_states=\array_merge(Size::getConstants(), Color::getConstants(), ["tag", "circular"]);
21 21
 		$this->addItems($labels);
22 22
 		$this->setStates($attributes);
23 23
 	}
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 			$icon=JArray::getValue($value, "icon", 1);
32 32
 			$tagName=JArray::getValue($value, "tagName", 2);
33 33
 		}
34
-		$labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName);
34
+		$labelO=new HtmlLabel("label-".$this->identifier, $caption, $icon, $tagName);
35 35
 		return $labelO;
36 36
 	}
37 37
 
38 38
 	protected function createCondition($value) {
39
-		return ($value instanceof HtmlLabel) === false;
39
+		return ($value instanceof HtmlLabel)===false;
40 40
 	}
41 41
 
42 42
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@
 block discarded – undo
14 14
 class HtmlContainer extends HtmlSemDoubleElement {
15 15
 	use TextAlignmentTrait;
16 16
 	public function __construct($identifier, $content="") {
17
-		parent::__construct($identifier, "div","ui container");
17
+		parent::__construct($identifier, "div", "ui container");
18 18
 		$this->content=$content;
19 19
 	}
20 20
 
21
-	public function asText(){
21
+	public function asText() {
22 22
 		return $this->addToProperty("class", "text");
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlDivider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @return HtmlDivider
24 24
 	 */
25 25
 	public function setVertical() {
26
-		return $this->addToPropertyCtrl("class", "vertical", array ("vertical","horizontal" ));
26
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical", "horizontal"));
27 27
 	}
28 28
 
29 29
 	/**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @return HtmlDivider
32 32
 	 */
33 33
 	public function setHorizontal() {
34
-		return $this->addToPropertyCtrl("class", "horizontal", array ("vertical","horizontal" ));
34
+		return $this->addToPropertyCtrl("class", "horizontal", array("vertical", "horizontal"));
35 35
 	}
36 36
 
37 37
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 * @return HtmlDivider
63 63
 	 */
64
-	public function setIgnored(){
64
+	public function setIgnored() {
65 65
 		return $this->addToProperty("class", "ignored");
66 66
 	}
67 67
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlRating.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	 * @param int $max
14 14
 	 * @param string $icon star or heart
15 15
 	 */
16
-	public function __construct($identifier, $value,$max=5,$icon="") {
16
+	public function __construct($identifier, $value, $max=5, $icon="") {
17 17
 		parent::__construct($identifier, "div", "ui {$icon} rating");
18 18
 		$this->setValue($value);
19 19
 		$this->setMax($max);
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\common\html\HtmlDoubleElement::setValue()
25 25
 	 */
26
-	public function setValue($value){
26
+	public function setValue($value) {
27 27
 		$this->setProperty("data-rating", $value);
28 28
 	}
29 29
 
30
-	public function setMax($max){
30
+	public function setMax($max) {
31 31
 		$this->setProperty("data-max-rating", $max);
32 32
 	}
33 33
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 	 * {@inheritDoc}
36 36
 	 * @see HtmlSemDoubleElement::run()
37 37
 	 */
38
-	public function run(JsUtils $js){
38
+	public function run(JsUtils $js) {
39 39
 		parent::run($js);
40
-		return $js->semantic()->rating("#".$this->identifier,$this->_params);
40
+		return $js->semantic()->rating("#".$this->identifier, $this->_params);
41 41
 	}
42 42
 
43
-	public function asStar(){
43
+	public function asStar() {
44 44
 		return $this->setIcon();
45 45
 	}
46 46
 
47
-	public function asHeart(){
47
+	public function asHeart() {
48 48
 		return $this->setIcon("heart");
49 49
 	}
50 50
 
51
-	public function setIcon($icon="star"){
52
-		return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]);
51
+	public function setIcon($icon="star") {
52
+		return $this->addToPropertyCtrl("class", $icon, ["star", "heart", ""]);
53 53
 	}
54 54
 
55 55
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlShape.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function getSideContent($index){
54 54
 		$item= $this->getItem($index);
55
-		if(isset($item))
56
-			return $item->getContent();
55
+		if(isset($item)) {
56
+					return $item->getContent();
57
+		}
57 58
 		return null;
58 59
 	}
59 60
 
@@ -147,15 +148,17 @@  discard block
 block discarded – undo
147 148
 	 * @see BaseHtml::run()
148 149
 	 */
149 150
 	public function run(JsUtils $js) {
150
-		if (isset($this->_bsComponent) === false)
151
-			$this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params);
151
+		if (isset($this->_bsComponent) === false) {
152
+					$this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params);
153
+		}
152 154
 		$this->addEventsOnRun($js);
153 155
 		return $this->_bsComponent;
154 156
 	}
155 157
 
156 158
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
157
-		if($this->_autoActive)
158
-			$this->setActiveSide(0);
159
+		if($this->_autoActive) {
160
+					$this->setActiveSide(0);
161
+		}
159 162
 		return parent::compile($js,$view);
160 163
 	}
161 164
 }
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 use Ajax\common\html\BaseHtml;
9 9
 
10 10
 
11
-class HtmlShape extends HtmlSemCollection{
11
+class HtmlShape extends HtmlSemCollection {
12 12
 
13 13
 	protected $_params=array();
14 14
 	protected $_autoActive=true;
15 15
 
16
-	public function __construct( $identifier, $sides){
17
-		parent::__construct( $identifier, "div", "ui shape");
16
+	public function __construct($identifier, $sides) {
17
+		parent::__construct($identifier, "div", "ui shape");
18 18
 		$this->_template='<%tagName% id="%identifier%" %properties%><div class="sides">%wrapContentBefore%%content%%wrapContentAfter%</div></%tagName%>';
19 19
 		$this->addItems($sides);
20 20
 	}
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
25 25
 	 */
26
-	protected function createItem($value){
27
-		if(\is_object($value)===false){
28
-			$value=new HtmlSemDoubleElement("","div","content",$value);
26
+	protected function createItem($value) {
27
+		if (\is_object($value)===false) {
28
+			$value=new HtmlSemDoubleElement("", "div", "content", $value);
29 29
 		}
30 30
 		return new HtmlShapeItem("side-".$this->identifier."-".$this->count(), $value);
31 31
 	}
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * {@inheritDoc}
35 35
 	 * @see \Ajax\common\html\HtmlCollection::createCondition()
36 36
 	 */
37
-	protected function createCondition($value){
37
+	protected function createCondition($value) {
38 38
 		return ($value instanceof HtmlShapeItem)===false;
39 39
 	}
40 40
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param int $index
43 43
 	 * @return \Ajax\semantic\html\content\HtmlShapeItem
44 44
 	 */
45
-	public function getSide($index){
45
+	public function getSide($index) {
46 46
 		return $this->getItem($index);
47 47
 	}
48 48
 
@@ -50,96 +50,96 @@  discard block
 block discarded – undo
50 50
 	 * @param int $index
51 51
 	 * @return mixed|NULL
52 52
 	 */
53
-	public function getSideContent($index){
54
-		$item= $this->getItem($index);
55
-		if(isset($item))
53
+	public function getSideContent($index) {
54
+		$item=$this->getItem($index);
55
+		if (isset($item))
56 56
 			return $item->getContent();
57 57
 		return null;
58 58
 	}
59 59
 
60
-	public function jsDo($action){
60
+	public function jsDo($action) {
61 61
 		return "$('#".$this->identifier."').shape('".$action."');";
62 62
 	}
63 63
 
64
-	public function jsFlipLeft(){
64
+	public function jsFlipLeft() {
65 65
 		return $this->jsDo("flip left");
66 66
 	}
67 67
 
68
-	public function jsFlipRight(){
68
+	public function jsFlipRight() {
69 69
 		return $this->jsDo("flip right");
70 70
 	}
71 71
 
72
-	public function jsFlipUp(){
72
+	public function jsFlipUp() {
73 73
 		return $this->jsDo("flip up");
74 74
 	}
75 75
 
76
-	public function jsFlipDown(){
76
+	public function jsFlipDown() {
77 77
 		return $this->jsDo("flip down");
78 78
 	}
79 79
 
80
-	public function jsFlipOver(){
80
+	public function jsFlipOver() {
81 81
 		return $this->jsDo("flip over");
82 82
 	}
83 83
 
84
-	public function jsFlipBack(){
84
+	public function jsFlipBack() {
85 85
 		return $this->jsDo("flip back");
86 86
 	}
87 87
 
88
-	private function doActionOn($element,$event,$what){
89
-		if($element instanceof BaseHtml){
90
-			return $element->on($event, $what,true,true);
88
+	private function doActionOn($element, $event, $what) {
89
+		if ($element instanceof BaseHtml) {
90
+			return $element->on($event, $what, true, true);
91 91
 		}
92 92
 	}
93 93
 
94
-	public function flipLeftOn($element,$event){
94
+	public function flipLeftOn($element, $event) {
95 95
 		return $this->doActionOn($element, $event, $this->jsFlipLeft());
96 96
 	}
97 97
 
98
-	public function flipRightOn($element,$event){
98
+	public function flipRightOn($element, $event) {
99 99
 		return $this->doActionOn($element, $event, $this->jsFlipRight());
100 100
 	}
101 101
 
102
-	public function flipUpOn($element,$event){
102
+	public function flipUpOn($element, $event) {
103 103
 		return $this->doActionOn($element, $event, $this->jsFlipUp());
104 104
 	}
105 105
 
106
-	public function flipDownOn($element,$event){
106
+	public function flipDownOn($element, $event) {
107 107
 		return $this->doActionOn($element, $event, $this->jsFlipDown());
108 108
 	}
109 109
 
110
-	public function flipBackOn($element,$event){
110
+	public function flipBackOn($element, $event) {
111 111
 		return $this->doActionOn($element, $event, $this->jsFlipBack());
112 112
 	}
113 113
 
114
-	public function flipOverOn($element,$event){
114
+	public function flipOverOn($element, $event) {
115 115
 		return $this->doActionOn($element, $event, $this->jsFlipOver());
116 116
 	}
117 117
 
118
-	public function setActiveSide($index){
118
+	public function setActiveSide($index) {
119 119
 		$side=$this->getSide($index);
120
-		if(isset($side)){
120
+		if (isset($side)) {
121 121
 			$side->setActive(true);
122 122
 		}
123 123
 		return $this;
124 124
 	}
125 125
 
126
-	public function asCube(){
126
+	public function asCube() {
127 127
 		return $this->addToPropertyCtrl("class", "cube", ["cube"]);
128 128
 	}
129 129
 
130
-	public function asText(){
130
+	public function asText() {
131 131
 		return $this->addToPropertyCtrl("class", "text", ["text"]);
132 132
 	}
133 133
 
134
-	public function setWidth($width="initial"){
134
+	public function setWidth($width="initial") {
135 135
 		$this->_params["width"]=$width;
136 136
 	}
137
-	public function onChange($jsCode){
138
-		return $this->_params["onChange"]="%function(){" . $jsCode . "}%";
137
+	public function onChange($jsCode) {
138
+		return $this->_params["onChange"]="%function(){".$jsCode."}%";
139 139
 	}
140 140
 
141
-	public function beforeChange($jsCode){
142
-		return $this->_params["beforeChange"]="%function(){" . $jsCode . "}%";
141
+	public function beforeChange($jsCode) {
142
+		return $this->_params["beforeChange"]="%function(){".$jsCode."}%";
143 143
 	}
144 144
 
145 145
 	/*
@@ -147,15 +147,15 @@  discard block
 block discarded – undo
147 147
 	 * @see BaseHtml::run()
148 148
 	 */
149 149
 	public function run(JsUtils $js) {
150
-		if (isset($this->_bsComponent) === false)
151
-			$this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params);
150
+		if (isset($this->_bsComponent)===false)
151
+			$this->_bsComponent=$js->semantic()->shape("#".$this->identifier, $this->_params);
152 152
 		$this->addEventsOnRun($js);
153 153
 		return $this->_bsComponent;
154 154
 	}
155 155
 
156 156
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
157
-		if($this->_autoActive)
157
+		if ($this->_autoActive)
158 158
 			$this->setActiveSide(0);
159
-		return parent::compile($js,$view);
159
+		return parent::compile($js, $view);
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.