Completed
Push — master ( 84f5b5...fd30d0 )
by Jean-Christophe
03:25
created
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -330,8 +330,9 @@  discard block
 block discarded – undo
330 330
 			$result= $this->getBody()->_addRow($result);
331 331
 		}
332 332
 		if(isset($this->_afterCompileEvents["onNewRow"])){
333
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
334
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
333
+			if(\is_callable($this->_afterCompileEvents["onNewRow"])) {
334
+							$this->_afterCompileEvents["onNewRow"]($result,$object);
335
+			}
335 336
 		}
336 337
 		return $result;
337 338
 	}
@@ -353,8 +354,9 @@  discard block
 block discarded – undo
353 354
 
354 355
 	public function run(JsUtils $js){
355 356
 		$result= parent::run($js);
356
-		if(isset($this->_footer))
357
-			$this->_footer->run($js);
357
+		if(isset($this->_footer)) {
358
+					$this->_footer->run($js);
359
+		}
358 360
 		return $result;
359 361
 	}
360 362
 
@@ -394,8 +396,9 @@  discard block
 block discarded – undo
394 396
 
395 397
 	public function setColWidth($colIndex,$width){
396 398
 		$part=$this->_getFirstPart();
397
-		if($part!==null && $part->count()>0)
398
-			$part->getCell(0, $colIndex)->setWidth($width);
399
+		if($part!==null && $part->count()>0) {
400
+					$part->getCell(0, $colIndex)->setWidth($width);
401
+		}
399 402
 		return $this;
400 403
 	}
401 404
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
24 24
 		parent::__construct($identifier, $tagName, "");
25
-		if (isset($rowCount) && isset($colCount))
26
-			$this->setRowCount($rowCount, $colCount);
25
+		if (isset($rowCount) && isset($colCount)) {
26
+					$this->setRowCount($rowCount, $colCount);
27
+		}
27 28
 	}
28 29
 
29 30
 	/**
@@ -148,8 +149,9 @@  discard block
 block discarded – undo
148 149
 			$values=\array_fill(0, $count, $values);
149 150
 			$isArray=false;
150 151
 		}
151
-		if (JArray::dimension($values) == 1 && $isArray)
152
-			$values=[ $values ];
152
+		if (JArray::dimension($values) == 1 && $isArray) {
153
+					$values=[ $values ];
154
+		}
153 155
 
154 156
 		$count=\min(\sizeof($values), $count);
155 157
 
@@ -193,8 +195,9 @@  discard block
 block discarded – undo
193 195
 		$count=$this->count();
194 196
 		for($i=0; $i < $count; $i++) {
195 197
 			$index=$this->content[$i]->getColPosition($colIndex);
196
-			if ($index !== NULL)
197
-				$this->getCell($i, $index)->$function();
198
+			if ($index !== NULL) {
199
+							$this->getCell($i, $index)->$function();
200
+			}
198 201
 		}
199 202
 		return $this;
200 203
 	}
@@ -225,8 +228,9 @@  discard block
 block discarded – undo
225 228
 	 */
226 229
 	public function getColCount() {
227 230
 		$result=0;
228
-		if ($this->count() > 0)
229
-			$result=$this->getItem(0)->count();
231
+		if ($this->count() > 0) {
232
+					$result=$this->getItem(0)->count();
233
+		}
230 234
 		return $result;
231 235
 	}
232 236
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/traits/TableTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,15 +22,17 @@
 block discarded – undo
22 22
 
23 23
 	public function setBasic($very=false) {
24 24
 		$table=$this->_self;
25
-		if ($very)
26
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
25
+		if ($very) {
26
+					$table->addToPropertyCtrl("class", "very", array ("very" ));
27
+		}
27 28
 		return $table->addToPropertyCtrl("class", "basic", array ("basic" ));
28 29
 	}
29 30
 
30 31
 	public function setCompact($very=false) {
31 32
 		$table=$this->_self;
32
-		if ($very)
33
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
33
+		if ($very) {
34
+					$table->addToPropertyCtrl("class", "very", array ("very" ));
35
+		}
34 36
 		return $table->addToPropertyCtrl("class", "compact", array ("compact" ));
35 37
 	}
36 38
 
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	public function getProperty($name) {
37
-		if (array_key_exists($name, $this->_self->properties))
38
-			return $this->_self->properties[$name];
37
+		if (array_key_exists($name, $this->_self->properties)) {
38
+					return $this->_self->properties[$name];
39
+		}
39 40
 	}
40 41
 
41 42
 	public function addToProperty($name, $value, $separator=" ") {
@@ -45,10 +46,11 @@  discard block
 block discarded – undo
45 46
 			}
46 47
 		} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
47 48
 			$v=@$this->_self->properties[$name];
48
-			if (isset($v) && $v !== "")
49
-				$v=$v . $separator . $value;
50
-				else
51
-					$v=$value;
49
+			if (isset($v) && $v !== "") {
50
+							$v=$v . $separator . $value;
51
+			} else {
52
+									$v=$value;
53
+				}
52 54
 
53 55
 					return $this->_self->setProperty($name, $v);
54 56
 		}
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
 	}
72 74
 
73 75
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
74
-		if (@class_exists($typeCtrl, true))
75
-			$typeCtrl=$typeCtrl::getConstants();
76
+		if (@class_exists($typeCtrl, true)) {
77
+					$typeCtrl=$typeCtrl::getConstants();
78
+		}
76 79
 			if (\is_array($typeCtrl)) {
77 80
 				$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);
78 81
 			}
@@ -91,8 +94,9 @@  discard block
 block discarded – undo
91 94
 	}
92 95
 
93 96
 	public function removeProperty($name) {
94
-		if (\array_key_exists($name, $this->_self->properties))
95
-			unset($this->_self->properties[$name]);
97
+		if (\array_key_exists($name, $this->_self->properties)) {
98
+					unset($this->_self->properties[$name]);
99
+		}
96 100
 			return $this;
97 101
 	}
98 102
 
@@ -105,8 +109,9 @@  discard block
 block discarded – undo
105 109
 	}
106 110
 
107 111
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
108
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
109
-			return $this->_self->setProperty($name, $value);
112
+		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
113
+					return $this->_self->setProperty($name, $value);
114
+		}
110 115
 			return $this;
111 116
 	}
112 117
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 				$this->_generateFields($form, [$v], $headers, $i, $wrappers);
64 64
 				$i++;
65 65
 			}
66
-		}else{
66
+		} else{
67 67
 			$separators[]=$count;
68 68
 			for($i=0;$i<$size;$i++){
69 69
 				$fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]);
@@ -74,17 +74,19 @@  discard block
 block discarded – undo
74 74
 
75 75
 	protected function _generateFields($form,$values,$headers,$sepFirst,$wrappers){
76 76
 		$wrapper=null;
77
-		if(isset($headers[$sepFirst+1]))
78
-			$form->addHeader($headers[$sepFirst+1],4,true);
77
+		if(isset($headers[$sepFirst+1])) {
78
+					$form->addHeader($headers[$sepFirst+1],4,true);
79
+		}
79 80
 		if(isset($wrappers[$sepFirst+1])){
80 81
 			$wrapper=$wrappers[$sepFirst+1];
81 82
 		}
82 83
 		if(\sizeof($values)===1){
83 84
 			$added=$form->addField($values[0]);
84
-		}elseif(\sizeof($values)>1){
85
+		} elseif(\sizeof($values)>1){
85 86
 			$added=$form->addFields($values);
86
-		}else
87
-			return;
87
+		} else {
88
+					return;
89
+		}
88 90
 		if(isset($wrapper)){
89 91
 			$added->wrap($wrapper[0],$wrapper[1]);
90 92
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/HtmlViewGroups.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
 			if (isset($extra)) {
31 31
 				$result->addExtraContent($extra);
32 32
 			}
33
-		} else
34
-			$result->addItemContent($value);
33
+		} else {
34
+					$result->addItemContent($value);
35
+		}
35 36
 		return $result;
36 37
 	}
37 38
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/ContentPartTrait.php 1 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/HtmlViewContent.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 				$this->addImage($image);
29 29
 			}
30 30
 			$this->addHeaderContent($header, $metas, $description,$extra);
31
-		} else
32
-			$this->addContent($value);
31
+		} else {
32
+					$this->addContent($value);
33
+		}
33 34
 	}
34 35
 
35 36
 	public function addElement($content, $baseClass="",$part=NULL) {
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
 
63 64
 	public function addImage($src="", $alt="", $size=NULL) {
64 65
 		$image=new HtmlImg("img-", $src, $alt);
65
-		if (isset($size))
66
-			$image->setSize($size);
66
+		if (isset($size)) {
67
+					$image->setSize($size);
68
+		}
67 69
 		$this->content['image']=$image;
68 70
 		return $image;
69 71
 	}
@@ -86,8 +88,9 @@  discard block
 block discarded – undo
86 88
 			foreach ( $metas as $meta ) {
87 89
 				$this->addMeta($meta);
88 90
 			}
89
-		} else
90
-			$this->addMeta($metas);
91
+		} else {
92
+					$this->addMeta($metas);
93
+		}
91 94
 		return $this;
92 95
 	}
93 96
 
@@ -114,8 +117,9 @@  discard block
 block discarded – undo
114 117
 			$result=new HtmlSemDoubleElement("", "span", "", $caption);
115 118
 			$this->addContent($result);
116 119
 			$result->setFloated($direction);
117
-		} else
118
-			$result=$this->addContent($caption);
120
+		} else {
121
+					$result=$this->addContent($caption);
122
+		}
119 123
 		return $result;
120 124
 	}
121 125
 
@@ -127,8 +131,9 @@  discard block
 block discarded – undo
127 131
 	}
128 132
 
129 133
 	public function addHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) {
130
-		if(isset($header))
131
-			$this->addElement($header, "header");
134
+		if(isset($header)) {
135
+					$this->addElement($header, "header");
136
+		}
132 137
 		$this->addMetas($metas);
133 138
 		if (isset($description)) {
134 139
 			$this->addElement($description, "description");
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/HtmlViewItem.php 1 patch
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.