Passed
Push — master ( e7f105...afb7ea )
by Jean-Christophe
02:49
created
Ajax/semantic/html/elements/HtmlIcon.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 	public function asLink($href=NULL,$target=NULL) {
90 90
 		if (isset($href)) {
91 91
 			$_target="";
92
-			if(isset($target))
93
-				$_target="target='{$target}'";
92
+			if(isset($target)) {
93
+							$_target="target='{$target}'";
94
+			}
94 95
 			$this->wrap("<a href='" . $href . "' {$_target}>", "</a>");
95 96
 		}
96 97
 		return $this->addToProperty("class", "link");
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
 	 */
108 109
 	public function setBordered($inverted=false) {
109 110
 		$invertedStr="";
110
-		if ($inverted !== false)
111
-			$invertedStr=" inverted";
111
+		if ($inverted !== false) {
112
+					$invertedStr=" inverted";
113
+		}
112 114
 		return $this->addToProperty("class", "bordered" . $invertedStr);
113 115
 	}
114 116
 
@@ -121,12 +123,14 @@  discard block
 block discarded – undo
121 123
 	}
122 124
 
123 125
 	public function addLabel($label, $before=false, $icon=NULL) {
124
-		if($before)
125
-			$this->wrap($label);
126
-		else
127
-			$this->wrap("", $label);
128
-		if(isset($icon))
129
-			$this->addToIcon($icon);
126
+		if($before) {
127
+					$this->wrap($label);
128
+		} else {
129
+					$this->wrap("", $label);
130
+		}
131
+		if(isset($icon)) {
132
+					$this->addToIcon($icon);
133
+		}
130 134
 		return $this;
131 135
 	}
132 136
 
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
 	 * @param string $popupEvent
41 41
 	 */
42 42
 	public function setPopupAttributes($variation=NULL, $popupEvent=NULL) {
43
-		if (isset($this->_popup))
44
-			$this->_popup->setAttributes($variation, $popupEvent);
43
+		if (isset($this->_popup)) {
44
+					$this->_popup->setAttributes($variation, $popupEvent);
45
+		}
45 46
 	}
46 47
 
47 48
 	/**
@@ -96,8 +97,9 @@  discard block
 block discarded – undo
96 97
 		$labelO=$label;
97 98
 		if (\is_object($label) === false) {
98 99
 			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
99
-			if (isset($icon))
100
-				$labelO->addIcon($icon);
100
+			if (isset($icon)) {
101
+							$labelO->addIcon($icon);
102
+			}
101 103
 		} else {
102 104
 			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
103 105
 		}
@@ -124,10 +126,12 @@  discard block
 block discarded – undo
124 126
 	 * @return HtmlSemDoubleElement
125 127
 	 */
126 128
 	public function asLink($href=NULL,$target=NULL) {
127
-		if (isset($href))
128
-			$this->setProperty("href", $href);
129
-		if(isset($target))
130
-			$this->setProperty("target", $target);
129
+		if (isset($href)) {
130
+					$this->setProperty("href", $href);
131
+		}
132
+		if(isset($target)) {
133
+					$this->setProperty("target", $target);
134
+		}
131 135
 		return $this->setTagName("a");
132 136
 	}
133 137
 
@@ -138,8 +142,9 @@  discard block
 block discarded – undo
138 142
 	 */
139 143
 	public function jsShowDimmer($show=true) {
140 144
 		$status="hide";
141
-		if ($show === true)
142
-			$status="show";
145
+		if ($show === true) {
146
+					$status="show";
147
+		}
143 148
 		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
144 149
 	}
145 150
 
@@ -148,8 +153,9 @@  discard block
 block discarded – undo
148 153
 	 * @see BaseHtml::compile()
149 154
 	 */
150 155
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
151
-	if (isset($this->_popup))
152
-			$this->_popup->compile($js);
156
+	if (isset($this->_popup)) {
157
+				$this->_popup->compile($js);
158
+	}
153 159
 		return parent::compile($js, $view);
154 160
 	}
155 161
 
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
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	private function afterInsert($item) {
63
-		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
64
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
65
-		else {
63
+		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) {
64
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
65
+		} else {
66 66
 			$this->setSecondary();
67 67
 		}
68 68
 		return $item;
@@ -77,8 +77,9 @@  discard block
 block discarded – undo
77 77
 	public function addItem($item) {
78 78
 		$number=$item;
79 79
 		$item=parent::addItem($this->getItemToInsert($item));
80
-		if(\is_int($number))
81
-			$item->setProperty("data-page", $number);
80
+		if(\is_int($number)) {
81
+					$item->setProperty("data-page", $number);
82
+		}
82 83
 		return $this->afterInsert($item);
83 84
 	}
84 85
 
@@ -151,10 +152,11 @@  discard block
 block discarded – undo
151 152
 	}
152 153
 
153 154
 	public function setSecondary($value=true) {
154
-		if($value)
155
-			$this->addToProperty("class", "secondary");
156
-		else
157
-			$this->removePropertyValue("class", "secondary");
155
+		if($value) {
156
+					$this->addToProperty("class", "secondary");
157
+		} else {
158
+					$this->removePropertyValue("class", "secondary");
159
+		}
158 160
 		return $this;
159 161
 	}
160 162
 
@@ -174,8 +176,9 @@  discard block
 block discarded – undo
174 176
 		$this->apply(function (HtmlDoubleElement &$item) {
175 177
 			$item->setTagName("a");
176 178
 		});
177
-		if ($vertical === true)
178
-			$this->setVertical();
179
+		if ($vertical === true) {
180
+					$this->setVertical();
181
+		}
179 182
 		return $this->addToProperty("class", "tabular");
180 183
 	}
181 184
 
@@ -204,10 +207,11 @@  discard block
 block discarded – undo
204 207
 	 */
205 208
 	public function fromDatabaseObject($object, $function) {
206 209
 		$return=$function($object);
207
-		if (\is_array($return))
208
-			$this->addItems($return);
209
-		else
210
-			$this->addItem($return);
210
+		if (\is_array($return)) {
211
+					$this->addItems($return);
212
+		} else {
213
+					$this->addItem($return);
214
+		}
211 215
 	}
212 216
 
213 217
 	/**
@@ -240,8 +244,9 @@  discard block
 block discarded – undo
240 244
 	}
241 245
 
242 246
 	public function run(JsUtils $js){
243
-		if($this->identifier!=="" && !isset($this->_bsComponent))
244
-			$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
247
+		if($this->identifier!=="" && !isset($this->_bsComponent)) {
248
+					$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
249
+		}
245 250
 		$result= parent::run($js);
246 251
 		return $result->setItemSelector(".item");
247 252
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FormTrait.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			foreach ($ajaxSubmit as $ajaxSubmitItem){
49 49
 				$compilation.=$ajaxSubmitItem->compile($js);
50 50
 			}
51
-		}elseif($ajaxSubmit instanceof AjaxCall){
51
+		} elseif($ajaxSubmit instanceof AjaxCall){
52 52
 			$compilation=$ajaxSubmit->compile($js);
53 53
 		}
54 54
 		$compilation=str_ireplace("\"","%quote%", $compilation);
@@ -66,8 +66,9 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public function setAttached($value=true){
68 68
 		$form=$this->getForm();
69
-		if($value)
70
-			$form->addToPropertyCtrl("class", "attached", array ("attached" ));
69
+		if($value) {
70
+					$form->addToPropertyCtrl("class", "attached", array ("attached" ));
71
+		}
71 72
 		return $form;
72 73
 	}
73 74
 
@@ -89,10 +90,11 @@  discard block
 block discarded – undo
89 90
 	 */
90 91
 	public function submitOn($event,$identifierOrElement,$url,$responseElement,$parameters=NULL){
91 92
 		$form=$this->getForm();
92
-		if($identifierOrElement  instanceof BaseHtml)
93
-			$elem=$identifierOrElement;
94
-		else
95
-			$elem=$form->getElementById($identifierOrElement, $form->getContent());
93
+		if($identifierOrElement  instanceof BaseHtml) {
94
+					$elem=$identifierOrElement;
95
+		} else {
96
+					$elem=$form->getElementById($identifierOrElement, $form->getContent());
97
+		}
96 98
 		if(isset($elem)){
97 99
 			$this->_buttonAsSubmit($elem, $event,$url,$responseElement,$parameters);
98 100
 		}
@@ -120,8 +122,9 @@  discard block
 block discarded – undo
120 122
 	public function setSubmitParams($url,$responseElement=NULL,$parameters=NULL){
121 123
 		$form=$this->getForm();
122 124
 		$params=["form"=>$form->getIdentifier(),"responseElement"=>$responseElement,"url"=>$url,"stopPropagation"=>true];
123
-		if(\is_array($parameters))
124
-			$params=\array_merge($params,$parameters);
125
+		if(\is_array($parameters)) {
126
+					$params=\array_merge($params,$parameters);
127
+		}
125 128
 		$form->addValidationParam("_ajaxSubmit", new AjaxCall("postForm", $params));
126 129
 		return $this;
127 130
 	}
Please login to merge, or discard this patch.
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/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/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.