Passed
Push — master ( 6f52f8...fa067a )
by Jean-Christophe
01:55
created
Ajax/semantic/html/content/table/HtmlTD.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,15 +84,17 @@  discard block
 block discarded – undo
84 84
 
85 85
 	public function getColspan() {
86 86
 		$colspan=1;
87
-		if (\array_key_exists("colspan", $this->properties))
88
-			$colspan=$this->getProperty("colspan");
87
+		if (\array_key_exists("colspan", $this->properties)) {
88
+					$colspan=$this->getProperty("colspan");
89
+		}
89 90
 		return $colspan;
90 91
 	}
91 92
 
92 93
 	public function getRowspan() {
93 94
 		$rowspan=1;
94
-		if (\array_key_exists("rowspan", $this->properties))
95
-			$rowspan=$this->getProperty("rowspan");
95
+		if (\array_key_exists("rowspan", $this->properties)) {
96
+					$rowspan=$this->getProperty("rowspan");
97
+		}
96 98
 		return $rowspan;
97 99
 	}
98 100
 
@@ -129,7 +131,8 @@  discard block
 block discarded – undo
129 131
 	}
130 132
 
131 133
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
132
-		if(!$this->_deleted)
133
-			return parent::compile($js,$view);
134
+		if(!$this->_deleted) {
135
+					return parent::compile($js,$view);
136
+		}
134 137
 	}
135 138
 }
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 			foreach ($items as $k=>$v){
25 25
 				$this->addItem([$k,$v]);
26 26
 			}
27
-		}else{
27
+		} else{
28 28
 			foreach ($items as $item){
29 29
 				$this->addItem($item);
30 30
 			}
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 * @return \Ajax\common\html\HtmlDoubleElement
81 81
 	 */
82 82
 	public function getItem($index) {
83
-		if (is_int($index)&& isset($this->content[$index]))
84
-			return $this->content[$index];
85
-		else {
83
+		if (is_int($index)&& isset($this->content[$index])) {
84
+					return $this->content[$index];
85
+		} else {
86 86
 			$elm=$this->getElementById($index, $this->content);
87 87
 			return $elm;
88 88
 		}
@@ -144,10 +144,11 @@  discard block
 block discarded – undo
144 144
 		$i=0;
145 145
 		foreach ($properties as $k=>$v){
146 146
 			$c=$this->content[$i++];
147
-			if(isset($c))
148
-				$c->setProperty($k,$v);
149
-			else
150
-				return $this;
147
+			if(isset($c)) {
148
+							$c->setProperty($k,$v);
149
+			} else {
150
+							return $this;
151
+			}
151 152
 		}
152 153
 		return $this;
153 154
 	}
@@ -165,8 +166,7 @@  discard block
 block discarded – undo
165 166
 		foreach ($values as $i=>$value){
166 167
 			if(isset($this->content[$i])){
167 168
 				$this->content[$i]->setProperty($property,$value);
168
-			}
169
-			else{
169
+			} else{
170 170
 				return $this;
171 171
 			}
172 172
 		}
@@ -186,8 +186,7 @@  discard block
 block discarded – undo
186 186
 		foreach ($values as $i=>$value){
187 187
 			if(isset($this->content[$i])){
188 188
 				$this->content[$i++]->addToProperty($property,$value);
189
-			}
190
-			else{
189
+			} else{
191 190
 				return $this;
192 191
 			}
193 192
 		}
@@ -216,8 +215,9 @@  discard block
 block discarded – undo
216 215
 		foreach ( $this->content as $index=>$item ) {
217 216
 			if($item instanceof HtmlDoubleElement){
218 217
 				$href="";
219
-				if(isset($hrefs[$index]))
220
-					$href=$hrefs[$index];
218
+				if(isset($hrefs[$index])) {
219
+									$href=$hrefs[$index];
220
+				}
221 221
 				$item->asLink($href,$target);
222 222
 			}
223 223
 		}
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function getProperty($name) {
36
-		if (array_key_exists($name, $this->_self->properties))
37
-			return $this->_self->properties[$name];
36
+		if (array_key_exists($name, $this->_self->properties)) {
37
+					return $this->_self->properties[$name];
38
+		}
38 39
 	}
39 40
 
40 41
 	/**
@@ -76,8 +77,9 @@  discard block
 block discarded – undo
76 77
 	}
77 78
 
78 79
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
79
-		if (is_string($typeCtrl) && @class_exists($typeCtrl, true))
80
-			$typeCtrl=$typeCtrl::getConstants();
80
+		if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) {
81
+					$typeCtrl=$typeCtrl::getConstants();
82
+		}
81 83
 			if (\is_array($typeCtrl)) {
82 84
 				$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);
83 85
 			}
@@ -96,8 +98,9 @@  discard block
 block discarded – undo
96 98
 	}
97 99
 
98 100
 	public function removeProperty($name) {
99
-		if (\array_key_exists($name, $this->_self->properties))
100
-			unset($this->_self->properties[$name]);
101
+		if (\array_key_exists($name, $this->_self->properties)) {
102
+					unset($this->_self->properties[$name]);
103
+		}
101 104
 			return $this;
102 105
 	}
103 106
 
@@ -110,8 +113,9 @@  discard block
 block discarded – undo
110 113
 	}
111 114
 
112 115
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
113
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
114
-			return $this->_self->setProperty($name, $value);
116
+		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
117
+					return $this->_self->setProperty($name, $value);
118
+		}
115 119
 			return $this;
116 120
 	}
117 121
 
Please login to merge, or discard this patch.
Ajax/service/JString.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@
 block discarded – undo
64 64
 	}
65 65
 	
66 66
 	public static function doubleBackSlashes($value){
67
-		if(is_string($value))
68
-			return str_replace("\\", "\\\\", $value);
67
+		if(is_string($value)) {
68
+					return str_replace("\\", "\\\\", $value);
69
+		}
69 70
 			return $value;
70 71
 	}
71 72
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/JsonDataTable.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@
 block discarded – undo
59 59
 			$callback.=$js->trigger("#".$id." [name='selection[]']","change",false)."$('#".$id." tbody .ui.checkbox').checkbox();".$js->execOn("change", "#".$id." [name='selection[]']", $this->_getCheckedChange($js));
60 60
 			$callback.=$this->_generatePaginationScript($id);
61 61
 			if(isset($this->_urls["refresh"])){
62
-				if(isset($menu))
63
-				$js->jsonArrayOn("click", "#".$menu->getIdentifier()." a","#".$this->_identifier." tr.".$this->_modelClass, $this->_urls["refresh"],"post",["params"=>"{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}","jsCallback"=>$callback]);
62
+				if(isset($menu)) {
63
+								$js->jsonArrayOn("click", "#".$menu->getIdentifier()." a","#".$this->_identifier." tr.".$this->_modelClass, $this->_urls["refresh"],"post",["params"=>"{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}","jsCallback"=>$callback]);
64
+				}
64 65
 			}
65 66
 		}
66 67
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Braces   +28 added lines, -19 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
28 28
 		parent::__construct($identifier, $tagName, "");
29
-		if (isset($rowCount) && isset($colCount))
30
-			$this->setRowCount($rowCount, $colCount);
29
+		if (isset($rowCount) && isset($colCount)) {
30
+					$this->setRowCount($rowCount, $colCount);
31
+		}
31 32
 	}
32 33
 
33 34
 	/**
@@ -112,7 +113,7 @@  discard block
 block discarded – undo
112 113
 		$row=$this->getItem($row);
113 114
 		if (isset($row) && $row instanceof HtmlCollection) {
114 115
 			$col=$row->getItem($col);
115
-		}else{
116
+		} else{
116 117
 			$col=$row;
117 118
 		}
118 119
 		return $col;
@@ -170,8 +171,9 @@  discard block
 block discarded – undo
170 171
 			$values=\array_fill(0, $count, $values);
171 172
 			$isArray=false;
172 173
 		}
173
-		if (JArray::dimension($values) == 1 && $isArray)
174
-			$values=[ $values ];
174
+		if (JArray::dimension($values) == 1 && $isArray) {
175
+					$values=[ $values ];
176
+		}
175 177
 
176 178
 		$count=\min(\sizeof($values), $count);
177 179
 
@@ -198,8 +200,9 @@  discard block
 block discarded – undo
198 200
 		$count=$this->count();
199 201
 		for($i=0; $i < $count; $i++) {
200 202
 			$cell=$this->getCell($i, $colIndex);
201
-			if($cell instanceof BaseTrait)
202
-				$cell->addVariations($variations);
203
+			if($cell instanceof BaseTrait) {
204
+							$cell->addVariations($variations);
205
+			}
203 206
 		}
204 207
 		return $this;
205 208
 	}
@@ -208,8 +211,9 @@  discard block
 block discarded – undo
208 211
 		$count=$this->count();
209 212
 		for($i=0; $i < $count; $i++) {
210 213
 			$cell=$this->getCell($i, $colIndex);
211
-			if(isset($cell))
212
-				$cell->addToProperty($name,$value);
214
+			if(isset($cell)) {
215
+							$cell->addToProperty($name,$value);
216
+			}
213 217
 		}
214 218
 		return $this;
215 219
 	}
@@ -227,8 +231,9 @@  discard block
 block discarded – undo
227 231
 		$count=$this->count();
228 232
 		for($i=0; $i < $count; $i++) {
229 233
 			$index=$this->content[$i]->getColPosition($colIndex);
230
-			if ($index !== NULL)
231
-				$this->getCell($i, $index)->$function();
234
+			if ($index !== NULL) {
235
+							$this->getCell($i, $index)->$function();
236
+			}
232 237
 		}
233 238
 		return $this;
234 239
 	}
@@ -239,8 +244,9 @@  discard block
 block discarded – undo
239 244
 			$maxRow=$this->content[$i]->count();
240 245
 			$index=$maxRow-$colIndex-1;
241 246
 			if (($cell=$this->getCell($i, $index))!== NULL){
242
-				if($cell->getColspan()==1)
243
-					$cell->$function();
247
+				if($cell->getColspan()==1) {
248
+									$cell->$function();
249
+				}
244 250
 			}
245 251
 		}
246 252
 		return $this;
@@ -284,8 +290,9 @@  discard block
 block discarded – undo
284 290
 	 */
285 291
 	public function getColCount() {
286 292
 		$result=0;
287
-		if ($this->count() > 0)
288
-			$result=$this->getItem(0)->count();
293
+		if ($this->count() > 0) {
294
+					$result=$this->getItem(0)->count();
295
+		}
289 296
 		return $result;
290 297
 	}
291 298
 
@@ -309,8 +316,9 @@  discard block
 block discarded – undo
309 316
 
310 317
 	public function toDelete($rowIndex, $colIndex){
311 318
 		$row=$this->getItem($rowIndex);
312
-		if (isset($row) === true)
313
-			$row->toDelete($colIndex);
319
+		if (isset($row) === true) {
320
+					$row->toDelete($colIndex);
321
+		}
314 322
 		return $this;
315 323
 	}
316 324
 
@@ -408,8 +416,9 @@  discard block
 block discarded – undo
408 416
 		foreach ( $rows as $row ) {
409 417
 			$cell=$row->getItem($colIndex);
410 418
 			$value=$cell->getContent();
411
-			if($functionExists)
412
-				$value=\call_user_func($function,$value);
419
+			if($functionExists) {
420
+							$value=\call_user_func($function,$value);
421
+			}
413 422
 			if($value!==$identiqual){
414 423
 				if($counter>0 && isset($cellToMerge)){
415 424
 					$cellToMerge->setRowspan($counter);
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Braces   +22 added lines, -17 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	private function afterInsert($item) {
65
-		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
66
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
67
-		else {
65
+		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) {
66
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
67
+		} else {
68 68
 			$this->setSecondary();
69 69
 		}
70 70
 		return $item;
@@ -79,8 +79,9 @@  discard block
 block discarded – undo
79 79
 	public function addItem($item) {
80 80
 		$number=$item;
81 81
 		$item=parent::addItem($this->getItemToInsert($item));
82
-		if(\is_int($number))
83
-			$item->setProperty("data-page", $number);
82
+		if(\is_int($number)) {
83
+					$item->setProperty("data-page", $number);
84
+		}
84 85
 		return $this->afterInsert($item);
85 86
 	}
86 87
 
@@ -149,10 +150,11 @@  discard block
 block discarded – undo
149 150
 	}
150 151
 
151 152
 	public function setSecondary($value=true) {
152
-		if($value)
153
-			$this->addToProperty("class", "secondary");
154
-		else
155
-			$this->removePropertyValue("class", "secondary");
153
+		if($value) {
154
+					$this->addToProperty("class", "secondary");
155
+		} else {
156
+					$this->removePropertyValue("class", "secondary");
157
+		}
156 158
 		return $this;
157 159
 	}
158 160
 
@@ -172,8 +174,9 @@  discard block
 block discarded – undo
172 174
 		$this->apply(function (HtmlDoubleElement &$item) {
173 175
 			$item->setTagName("a");
174 176
 		});
175
-		if ($vertical === true)
176
-			$this->setVertical();
177
+		if ($vertical === true) {
178
+					$this->setVertical();
179
+		}
177 180
 		return $this->addToProperty("class", "tabular");
178 181
 	}
179 182
 
@@ -202,10 +205,11 @@  discard block
 block discarded – undo
202 205
 	 */
203 206
 	public function fromDatabaseObject($object, $function) {
204 207
 		$return=$function($object);
205
-		if (\is_array($return))
206
-			$this->addItems($return);
207
-		else
208
-			$this->addItem($return);
208
+		if (\is_array($return)) {
209
+					$this->addItems($return);
210
+		} else {
211
+					$this->addItem($return);
212
+		}
209 213
 	}
210 214
 
211 215
 	/**
@@ -238,8 +242,9 @@  discard block
 block discarded – undo
238 242
 	}
239 243
 
240 244
 	public function run(JsUtils $js){
241
-		if($this->identifier!=="" && !isset($this->_bsComponent))
242
-			$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
245
+		if($this->identifier!=="" && !isset($this->_bsComponent)) {
246
+					$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
247
+		}
243 248
 		$result= parent::run($js);
244 249
 		return $result->setItemSelector(">.item");
245 250
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,12 +29,14 @@  discard block
 block discarded – undo
29 29
 				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				} else
33
-					$label=NULL;
32
+				} else {
33
+									$label=NULL;
34
+				}
34 35
 			}
35 36
 		}
36
-		if (isset($label))
37
-			$this->setLabel($label);
37
+		if (isset($label)) {
38
+					$this->setLabel($label);
39
+		}
38 40
 		foreach ( $fields as $field ) {
39 41
 			$this->addItem($field);
40 42
 		}
@@ -57,8 +59,9 @@  discard block
 block discarded – undo
57 59
 
58 60
 	public function addItem($item) {
59 61
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
61
-			$item->setContainer($this);
62
+		if($item instanceof HtmlFormField) {
63
+					$item->setContainer($this);
64
+		}
62 65
 		return $item;
63 66
 	}
64 67
 	
@@ -73,8 +76,9 @@  discard block
 block discarded – undo
73 76
 		if ($this->_equalWidth) {
74 77
 			$count=$this->count();
75 78
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
76
-		} else
77
-			$this->addToProperty("class", "fields");
79
+		} else {
80
+					$this->addToProperty("class", "fields");
81
+		}
78 82
 		return parent::compile($js, $view);
79 83
 	}
80 84
 
@@ -115,8 +119,9 @@  discard block
 block discarded – undo
115 119
 			$fields[]=$itemO;
116 120
 		}
117 121
 		$radios=new HtmlFormFields($identifier, $fields);
118
-		if (isset($label))
119
-			$radios->setLabel($label)->setProperty("for", $name);
122
+		if (isset($label)) {
123
+					$radios->setLabel($label)->setProperty("for", $name);
124
+		}
120 125
 		return $radios;
121 126
 	}
122 127
 
@@ -132,8 +137,9 @@  discard block
 block discarded – undo
132 137
 			$fields[]=$itemO;
133 138
 		}
134 139
 		$radios=new HtmlFormFields($identifier, $fields);
135
-		if (isset($label))
136
-			$radios->setLabel($label)->setProperty("for", $name);
140
+		if (isset($label)) {
141
+					$radios->setLabel($label)->setProperty("for", $name);
142
+		}
137 143
 		return $radios;
138 144
 	}
139 145
 
Please login to merge, or discard this patch.
Ajax/common/html/HtmlDoubleElement.php 1 patch
Braces   +19 added lines, -15 removed lines patch added patch discarded remove patch
@@ -32,15 +32,17 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public function addContent($content,$before=false) {
34 34
 		if (!\is_array($this->content)) {
35
-			if(isset($this->content))
36
-				$this->content=array ($this->content);
37
-			else
38
-				$this->content=array();
35
+			if(isset($this->content)) {
36
+							$this->content=array ($this->content);
37
+			} else {
38
+							$this->content=array();
39
+			}
40
+		}
41
+		if($before) {
42
+					array_unshift($this->content,$content);
43
+		} else {
44
+					$this->content []=$content;
39 45
 		}
40
-		if($before)
41
-			array_unshift($this->content,$content);
42
-		else
43
-			$this->content []=$content;
44 46
 		return $this;
45 47
 	}
46 48
 
@@ -78,9 +80,9 @@  discard block
 block discarded – undo
78 80
 		$instances=[];
79 81
 		if($content instanceof $class){
80 82
 			$instances[]=$content;
81
-		}elseif($content instanceof HtmlDoubleElement){
83
+		} elseif($content instanceof HtmlDoubleElement){
82 84
 			$instances=\array_merge($instances,$content->getContentInstances($class));
83
-		}elseif (\is_array($content)){
85
+		} elseif (\is_array($content)){
84 86
 			foreach ($content as $element){
85 87
 				$instances=\array_merge($instances,$this->_getContentInstances($class, $element));
86 88
 			}
@@ -93,10 +95,12 @@  discard block
 block discarded – undo
93 95
 	 * @return HtmlDoubleElement
94 96
 	 */
95 97
 	public function asLink($href=NULL,$target=NULL) {
96
-		if (isset($href))
97
-			$this->setProperty("href", $href);
98
-		if(isset($target))
99
-			$this->setProperty("target", $target);
98
+		if (isset($href)) {
99
+					$this->setProperty("href", $href);
100
+		}
101
+		if(isset($target)) {
102
+					$this->setProperty("target", $target);
103
+		}
100 104
 		return $this->setTagName("a");
101 105
 	}
102 106
 	
@@ -121,7 +125,7 @@  discard block
 block discarded – undo
121 125
 			$this->_editableContent=$frm;
122 126
 			$keypress="";
123 127
 			$focusOut="";
124
-		}else{
128
+		} else{
125 129
 			$focusOut="if(e.relatedTarget==null)elm.trigger('endEdit');";
126 130
 			$this->_editableContent=$field;
127 131
 			$keypress="$('#".$idF."').keyup(function(e){if(e.which == 13) {\$('#".$idE."').trigger('validate',{value: $('#'+idF+' input').val()});}if(e.keyCode===27) {\$('#".$idE."').trigger('endEdit');}});";
Please login to merge, or discard this patch.