Completed
Push — master ( 5654ad...79746a )
by Jean-Christophe
05:00
created
Ajax/semantic/html/collections/form/HtmlFormInput.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@  discard block
 block discarded – undo
9 9
 	use TextFieldsTrait;
10 10
 
11 11
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
13
-			$placeholder=$label;
12
+		if(!isset($placeholder) && $type==="text") {
13
+					$placeholder=$label;
14
+		}
14 15
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
15 16
 		$this->_identifier=$identifier;
16 17
 	}
@@ -18,8 +19,9 @@  discard block
 block discarded – undo
18 19
 	public function getDataField(){
19 20
 		$field= $this->getField();
20 21
 		//TODO check getField
21
-		if($field instanceof HtmlInput)
22
-			$field=$field->getDataField();
22
+		if($field instanceof HtmlInput) {
23
+					$field=$field->getDataField();
24
+		}
23 25
 		return $field;
24 26
 	}
25 27
 }
26 28
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormTextarea.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@
 block discarded – undo
10 10
 	use TextFieldsTrait;
11 11
 
12 12
 	public function __construct($identifier, $label=NULL,$value=NULL,$placeholder=NULL,$rows=NULL) {
13
-		if(!isset($placeholder))
14
-			$placeholder=$label;
13
+		if(!isset($placeholder)) {
14
+					$placeholder=$label;
15
+		}
15 16
 		parent::__construct("field-".$identifier, new HtmlTextarea($identifier,$value,$placeholder,$rows), $label);
16 17
 		$this->_identifier=$identifier;
17 18
 	}
Please login to merge, or discard this patch.
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.