Completed
Push — master ( 72763d...864cd0 )
by Jean-Christophe
03:23
created
Ajax/semantic/html/base/traits/BaseTrait.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -47,8 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 	public function setVariations($variations) {
49 49
 		$this->setProperty("class", $this->_baseClass);
50
-		if (\is_string($variations))
51
-			$variations=\explode(" ", $variations);
50
+		if (\is_string($variations)) {
51
+					$variations=\explode(" ", $variations);
52
+		}
52 53
 		foreach ( $variations as $variation ) {
53 54
 			$this->addVariation($variation);
54 55
 		}
@@ -61,8 +62,9 @@  discard block
 block discarded – undo
61 62
 	}
62 63
 
63 64
 	public function addVariations($variations=array()) {
64
-		if (\is_string($variations))
65
-			$variations=\explode(" ", $variations);
65
+		if (\is_string($variations)) {
66
+					$variations=\explode(" ", $variations);
67
+		}
66 68
 		foreach ( $variations as $variation ) {
67 69
 			$this->addVariation($variation);
68 70
 		}
@@ -70,8 +72,9 @@  discard block
 block discarded – undo
70 72
 	}
71 73
 
72 74
 	public function addStates($states=array()) {
73
-		if (\is_string($states))
74
-			$states=\explode(" ", $states);
75
+		if (\is_string($states)) {
76
+					$states=\explode(" ", $states);
77
+		}
75 78
 		foreach ( $states as $state ) {
76 79
 			$this->addState($state);
77 80
 		}
@@ -80,8 +83,9 @@  discard block
 block discarded – undo
80 83
 
81 84
 	public function setStates($states) {
82 85
 		$this->setProperty("class", $this->_baseClass);
83
-		if (\is_string($states))
84
-			$states=\explode(" ", $states);
86
+		if (\is_string($states)) {
87
+					$states=\explode(" ", $states);
88
+		}
85 89
 		foreach ( $states as $state ) {
86 90
 			$this->addState($state);
87 91
 		}
@@ -113,8 +117,9 @@  discard block
 block discarded – undo
113 117
 	 * @return HtmlSemDoubleElement
114 118
 	 */
115 119
 	public function setDisabled($disable=true) {
116
-		if($disable)
117
-			$this->addToProperty("class", "disabled");
120
+		if($disable) {
121
+					$this->addToProperty("class", "disabled");
122
+		}
118 123
 		return $this;
119 124
 	}
120 125
 
@@ -148,14 +153,16 @@  discard block
 block discarded – undo
148 153
 	 * @return HtmlSemDoubleElement
149 154
 	 */
150 155
 	public function setActive($value=true){
151
-		if($value)
152
-			$this->addToProperty("class", "active");
156
+		if($value) {
157
+					$this->addToProperty("class", "active");
158
+		}
153 159
 		return $this;
154 160
 	}
155 161
 
156 162
 	public function setAttached($value=true){
157
-		if($value)
158
-			$this->addToPropertyCtrl("class", "attached", array ("attached" ));
163
+		if($value) {
164
+					$this->addToPropertyCtrl("class", "attached", array ("attached" ));
165
+		}
159 166
 		return $this;
160 167
 	}
161 168
 
@@ -191,10 +198,12 @@  discard block
 block discarded – undo
191 198
 			if(isset($array[$key])){
192 199
 				$p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, "");
193 200
 				$array[$key]=$before.$p.$value.$after;
194
-			}else
195
-				$array[$key]=$before.$value.$after;
196
-		}else
197
-			$array[$key]=$value;
201
+			} else {
202
+							$array[$key]=$before.$value.$after;
203
+			}
204
+		} else {
205
+					$array[$key]=$value;
206
+		}
198 207
 		return $this;
199 208
 	}
200 209
 }
201 210
\ No newline at end of file
Please login to merge, or discard this patch.