Passed
Push — master ( e33ab3...35deb2 )
by Jean-Christophe
02:27
created
Ajax/ui/components/DialogButton.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 class DialogButton extends BaseComponent {
15 15
 
16 16
 	private function addFunction($jsCode) {
17
-		if (!JString::startsWith($jsCode, "function"))
18
-			$jsCode="%function(){" . $jsCode . "}%";
17
+		if (!JString::startsWith($jsCode, "function")) {
18
+					$jsCode="%function(){" . $jsCode . "}%";
19
+		}
19 20
 		return $jsCode;
20 21
 	}
21 22
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlGrid.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 			// }
33 33
 			$this->setWide($numCols);
34 34
 		}
35
-		if($createCols)
36
-			$this->setRowsCount($numRows, $numCols);
35
+		if($createCols) {
36
+					$this->setRowsCount($numRows, $numCols);
37
+		}
37 38
 	}
38 39
 
39 40
 	public function asSegment() {
@@ -85,8 +86,9 @@  discard block
 block discarded – undo
85 86
 	public function addCol($width=NULL) {
86 87
 		$colCount=$this->colCount() + 1;
87 88
 		$this->setColsCount($colCount, true, $width);
88
-		if ($this->hasOnlyCols($this->count()))
89
-			return $this->content[$colCount - 1];
89
+		if ($this->hasOnlyCols($this->count())) {
90
+					return $this->content[$colCount - 1];
91
+		}
90 92
 		return $this;
91 93
 	}
92 94
 
@@ -174,8 +176,9 @@  discard block
 block discarded – undo
174 176
 	 */
175 177
 	public function rowCount() {
176 178
 		$count=$this->count();
177
-		if ($this->hasOnlyCols($count))
178
-			return 0;
179
+		if ($this->hasOnlyCols($count)) {
180
+					return 0;
181
+		}
179 182
 		return $count;
180 183
 	}
181 184
 
@@ -185,10 +188,12 @@  discard block
 block discarded – undo
185 188
 	 */
186 189
 	public function colCount() {
187 190
 		$count=$this->count();
188
-		if ($this->hasOnlyCols($count))
189
-			return $count;
190
-		if ($count > 0)
191
-			return $this->getItem(0)->count();
191
+		if ($this->hasOnlyCols($count)) {
192
+					return $count;
193
+		}
194
+		if ($count > 0) {
195
+					return $this->getItem(0)->count();
196
+		}
192 197
 		return 0;
193 198
 	}
194 199
 
@@ -199,8 +204,9 @@  discard block
 block discarded – undo
199 204
 	 * @return HtmlGridCol
200 205
 	 */
201 206
 	public function getCell($row, $col) {
202
-		if ($row < 2 && $this->hasOnlyCols($this->count()))
203
-			return $this->getItem($col);
207
+		if ($row < 2 && $this->hasOnlyCols($this->count())) {
208
+					return $this->getItem($col);
209
+		}
204 210
 		$row=$this->getItem($row);
205 211
 		if (isset($row)) {
206 212
 			$col=$row->getItem($col);
@@ -249,8 +255,9 @@  discard block
 block discarded – undo
249 255
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
250 256
 	 */
251 257
 	public function setPadded($value=NULL) {
252
-		if (isset($value))
253
-			$this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" ));
258
+		if (isset($value)) {
259
+					$this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" ));
260
+		}
254 261
 		return $this->addToProperty("class", "padded");
255 262
 	}
256 263
 
@@ -275,8 +282,9 @@  discard block
 block discarded – undo
275 282
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
276 283
 	 */
277 284
 	protected function createItem($value) {
278
-		if ($this->_createCols === false)
279
-			$value=null;
285
+		if ($this->_createCols === false) {
286
+					$value=null;
287
+		}
280 288
 		$item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows);
281 289
 		return $item;
282 290
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlDropdown.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	public function addItem($caption, $href="#") {
91 91
 		if($caption instanceof HtmlDropdownItem){
92 92
 			$item=$caption;
93
-		}else{
93
+		} else{
94 94
 			$iid=$this->getItemsCount()+1;
95 95
 			$item=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid);
96 96
 			$item->setCaption($caption)->setHref($href);
@@ -130,10 +130,11 @@  discard block
 block discarded – undo
130 130
 	 * @see BaseHtml::fromArray()
131 131
 	 */
132 132
 	public function fromArray($array) {
133
-		if (array_keys($array)!==range(0, count($array)-1))
134
-			return parent::fromArray($array);
135
-		else
136
-			return $this->addItems($array);
133
+		if (array_keys($array)!==range(0, count($array)-1)) {
134
+					return parent::fromArray($array);
135
+		} else {
136
+					return $this->addItems($array);
137
+		}
137 138
 	}
138 139
 
139 140
 	public function setItems($items) {
@@ -186,8 +187,9 @@  discard block
 block discarded – undo
186 187
 	 * @see BaseHtml::setTagName()
187 188
 	 */
188 189
 	public function setTagName($tagName) {
189
-		if ($tagName=="button")
190
-			$this->class="btn dropdown-toggle";
190
+		if ($tagName=="button") {
191
+					$this->class="btn dropdown-toggle";
192
+		}
191 193
 		return parent::setTagName($tagName);
192 194
 	}
193 195
 
@@ -205,8 +207,9 @@  discard block
 block discarded – undo
205 207
 	}
206 208
 
207 209
 	public function setAlignment($alignment) {
208
-		if (is_int($alignment))
209
-			$alignment="dropdown-menu-".CssRef::alignment()[$alignment];
210
+		if (is_int($alignment)) {
211
+					$alignment="dropdown-menu-".CssRef::alignment()[$alignment];
212
+		}
210 213
 		return $this->addToMemberCtrl($this->class, $alignment, CssRef::alignment());
211 214
 	}
212 215
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlListgroupItem.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@
 block discarded – undo
40 40
 	 * @return HtmlListgroupItem default : "list-group-item-default"
41 41
 	 */
42 42
 	public function setStyle($cssStyle) {
43
-		if (!JString::startsWith($cssStyle, "list-group-item"))
44
-			$cssStyle="list-group-item".$cssStyle;
43
+		if (!JString::startsWith($cssStyle, "list-group-item")) {
44
+					$cssStyle="list-group-item".$cssStyle;
45
+		}
45 46
 		$this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item"));
46 47
 		return $this->element;
47 48
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPagination.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
 		$this->from=$from;
53 53
 		$this->to=$to;
54 54
 		$this->urlMask="%page%";
55
-		if(!isset($countVisible))
56
-			$this->countVisible=$to-$from+1;
57
-		else
58
-			$this->countVisible=$countVisible;
55
+		if(!isset($countVisible)) {
56
+					$this->countVisible=$to-$from+1;
57
+		} else {
58
+					$this->countVisible=$countVisible;
59
+		}
59 60
 		$this->createContent();
60 61
 	}
61 62
 
@@ -74,7 +75,7 @@  discard block
 block discarded – undo
74 75
 			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
75 76
 			$href->setProperty($this->attr, $url);
76 77
 			$elem->setContent($href);
77
-		}else{
78
+		} else{
78 79
 			$elem->setContent($content);
79 80
 		}
80 81
 		$this->content[]=$elem;
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
 	public function _addEvent($event, $jsCode) {
108 109
 		foreach ($this->content as $li){
109 110
 			$content=$li->getContent();
110
-			if($content instanceof BaseHtml)
111
-				$content->_addEvent($event,$jsCode);
111
+			if($content instanceof BaseHtml) {
112
+							$content->_addEvent($event,$jsCode);
113
+			}
112 114
 		}
113 115
 	}
114 116
 	/**
@@ -146,8 +148,9 @@  discard block
 block discarded – undo
146 148
 		if (is_int($size)) {
147 149
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
148 150
 		}
149
-		if(!JString::startsWith($size, "pagination-") && $size!=="")
150
-			$size="pagination-".$size;
151
+		if(!JString::startsWith($size, "pagination-") && $size!=="") {
152
+					$size="pagination-".$size;
153
+		}
151 154
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
152 155
 	}
153 156
 
Please login to merge, or discard this patch.