Completed
Push — master ( 138cdf...e53430 )
by Jean-Christophe
03:16
created
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,16 +58,17 @@
 block discarded – undo
58 58
 			foreach ($values as $v){
59 59
 				$form->addField($v);
60 60
 			}
61
-		}else{
61
+		} else{
62 62
 			$separators[]=$count;
63 63
 			for($i=0;$i<$size;$i++){
64 64
 				$fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]);
65
-				if(isset($headers[$separators[$i]+1]))
66
-					$form->addHeader($headers[$separators[$i]+1],4,true);
65
+				if(isset($headers[$separators[$i]+1])) {
66
+									$form->addHeader($headers[$separators[$i]+1],4,true);
67
+				}
67 68
 				//TODO check why $fields is empty
68 69
 				if(\sizeof($fields)===1){
69 70
 					$form->addField($fields[0]);
70
-				}elseif(\sizeof($fields)>1){
71
+				} elseif(\sizeof($fields)>1){
71 72
 					$form->addFields($fields);
72 73
 				}
73 74
 			}
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
@@ -46,8 +46,9 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function setVariations($variations) {
48 48
 		$this->setProperty("class", $this->_baseClass);
49
-		if (\is_string($variations))
50
-			$variations=\explode(" ", $variations);
49
+		if (\is_string($variations)) {
50
+					$variations=\explode(" ", $variations);
51
+		}
51 52
 		foreach ( $variations as $variation ) {
52 53
 			$this->addVariation($variation);
53 54
 		}
@@ -60,8 +61,9 @@  discard block
 block discarded – undo
60 61
 	}
61 62
 
62 63
 	public function addVariations($variations=array()) {
63
-		if (\is_string($variations))
64
-			$variations=\explode(" ", $variations);
64
+		if (\is_string($variations)) {
65
+					$variations=\explode(" ", $variations);
66
+		}
65 67
 		foreach ( $variations as $variation ) {
66 68
 			$this->addVariation($variation);
67 69
 		}
@@ -69,8 +71,9 @@  discard block
 block discarded – undo
69 71
 	}
70 72
 
71 73
 	public function addStates($states=array()) {
72
-		if (\is_string($states))
73
-			$states=\explode(" ", $states);
74
+		if (\is_string($states)) {
75
+					$states=\explode(" ", $states);
76
+		}
74 77
 		foreach ( $states as $state ) {
75 78
 			$this->addState($state);
76 79
 		}
@@ -79,8 +82,9 @@  discard block
 block discarded – undo
79 82
 
80 83
 	public function setStates($states) {
81 84
 		$this->setProperty("class", $this->_baseClass);
82
-		if (\is_string($states))
83
-			$states=\explode(" ", $states);
85
+		if (\is_string($states)) {
86
+					$states=\explode(" ", $states);
87
+		}
84 88
 		foreach ( $states as $state ) {
85 89
 			$this->addState($state);
86 90
 		}
@@ -112,8 +116,9 @@  discard block
 block discarded – undo
112 116
 	 * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement
113 117
 	 */
114 118
 	public function setDisabled($disable=true) {
115
-		if($disable)
116
-			$this->addToProperty("class", "disabled");
119
+		if($disable) {
120
+					$this->addToProperty("class", "disabled");
121
+		}
117 122
 		return $this;
118 123
 	}
119 124
 
@@ -147,14 +152,16 @@  discard block
 block discarded – undo
147 152
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
148 153
 	 */
149 154
 	public function setActive($value=true){
150
-		if($value)
151
-			$this->addToProperty("class", "active");
155
+		if($value) {
156
+					$this->addToProperty("class", "active");
157
+		}
152 158
 		return $this;
153 159
 	}
154 160
 
155 161
 	public function setAttached($value=true){
156
-		if($value)
157
-			$this->addToPropertyCtrl("class", "attached", array ("attached" ));
162
+		if($value) {
163
+					$this->addToPropertyCtrl("class", "attached", array ("attached" ));
164
+		}
158 165
 		return $this;
159 166
 	}
160 167
 
@@ -190,10 +197,12 @@  discard block
 block discarded – undo
190 197
 			if(isset($array[$key])){
191 198
 				$p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, "");
192 199
 				$array[$key]=$before.$p.$value.$after;
193
-			}else
194
-				$array[$key]=$before.$value.$after;
195
-		}else
196
-			$array[$key]=$value;
200
+			} else {
201
+							$array[$key]=$before.$value.$after;
202
+			}
203
+		} else {
204
+					$array[$key]=$value;
205
+		}
197 206
 		return $this;
198 207
 	}
199 208
 }
200 209
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormField.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
 		parent::__construct($identifier, "div","field");
19 19
 		$this->content=array();
20 20
 		$this->_states=[State::ERROR,State::DISABLED];
21
-		if(isset($label) && $label!=="")
22
-			$this->setLabel($label);
21
+		if(isset($label) && $label!=="") {
22
+					$this->setLabel($label);
23
+		}
23 24
 		$this->setField($field);
24 25
 		$this->_validation=NULL;
25 26
 	}
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
 	 * @return mixed
51 52
 	 */
52 53
 	public function getLabel(){
53
-		if(\array_key_exists("label", $this->content))
54
-			return $this->content["label"];
54
+		if(\array_key_exists("label", $this->content)) {
55
+					return $this->content["label"];
56
+		}
55 57
 	}
56 58
 
57 59
 	/**
Please login to merge, or discard this patch.