Passed
Push — master ( a8574f...277c03 )
by Jean-Christophe
02:28
created
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.
Ajax/semantic/widgets/base/FieldAsTrait.php 1 patch
Braces   +18 added lines, -14 removed lines patch added patch discarded remove patch
@@ -64,8 +64,7 @@  discard block
 block discarded – undo
64 64
 			$rules=$attributes["rules"];
65 65
 			if(\is_array($rules)){
66 66
 				$element->addRules($rules);
67
-			}
68
-			else{
67
+			} else{
69 68
 				$element->addRule($rules);
70 69
 			}
71 70
 			unset($attributes["rules"]);
@@ -117,8 +116,9 @@  discard block
 block discarded – undo
117 116
 	public function fieldAsLabel($index,$icon=NULL,$attributes=NULL){
118 117
 		return $this->_fieldAs(function($id,$name,$value) use($icon){
119 118
 			$lbl=new HtmlLabel($id,$value);
120
-			if(isset($icon))
121
-				$lbl->addIcon($icon);
119
+			if(isset($icon)) {
120
+							$lbl->addIcon($icon);
121
+			}
122 122
 				return $lbl;
123 123
 		}, $index,$attributes,"label");
124 124
 	}
@@ -126,8 +126,9 @@  discard block
 block discarded – undo
126 126
 	public function fieldAsHeader($index,$niveau=1,$icon=NULL,$attributes=NULL){
127 127
 		return $this->_fieldAs(function($id,$name,$value) use($niveau,$icon){
128 128
 			$header=new HtmlHeader($id,$niveau,$value);
129
-			if(isset($icon))
130
-				$header->asIcon($icon, $value);
129
+			if(isset($icon)) {
130
+							$header->asIcon($icon, $value);
131
+			}
131 132
 			return $header;
132 133
 		}, $index,$attributes,"header");
133 134
 	}
@@ -135,7 +136,9 @@  discard block
 block discarded – undo
135 136
 
136 137
 	public function fieldAsImage($index,$size=Size::MINI,$circular=false){
137 138
 		$this->setValueFunction($index,function($img) use($size,$circular){
138
-			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular();
139
+			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) {
140
+				$image->setCircular();
141
+			}
139 142
 			return $image;
140 143
 		});
141 144
 			return $this;
@@ -194,8 +197,9 @@  discard block
 block discarded – undo
194 197
 
195 198
 	public function fieldAsCheckbox($index,$attributes=NULL){
196 199
 		return $this->_fieldAs(function($id,$name,$value,$caption) use($attributes){
197
-			if($caption===null || $caption==="")
198
-				$caption="";
200
+			if($caption===null || $caption==="") {
201
+							$caption="";
202
+			}
199 203
 			$input=new HtmlFormCheckbox($id,$caption,$this->_instanceViewer->getIdentifier());
200 204
 			$input->setChecked(JString::isBooleanTrue($value));
201 205
 			return $this->_prepareFormFields($input, $name, $attributes);
@@ -232,14 +236,14 @@  discard block
 block discarded – undo
232 236
 		$i=0;
233 237
 		if(JArray::isAssociative($types)){
234 238
 			foreach ($types as $type=>$attributes){
235
-				if(\is_int($type))
236
-					$this->fieldAs($i++,$attributes,[]);
237
-				else{
239
+				if(\is_int($type)) {
240
+									$this->fieldAs($i++,$attributes,[]);
241
+				} else{
238 242
 					$type=preg_replace('/\d/', '', $type );
239 243
 					$this->fieldAs($i++,$type,$attributes);
240 244
 				}
241 245
 			}
242
-		}else{
246
+		} else{
243 247
 			foreach ($types as $type){
244 248
 				$this->fieldAs($i++,$type);
245 249
 			}
@@ -251,7 +255,7 @@  discard block
 block discarded – undo
251 255
 		if(\method_exists($this, $method)){
252 256
 			if(!\is_array($attributes)){
253 257
 				$attributes=[$index];
254
-			}else{
258
+			} else{
255 259
 				\array_unshift($attributes, $index);
256 260
 			}
257 261
 			\call_user_func_array([$this,$method], $attributes);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
23 23
 		parent::__construct($identifier, $tagName, "ui label");
24 24
 		$this->content=$caption;
25
-		if (isset($icon))
26
-			$this->addIcon($icon);
25
+		if (isset($icon)) {
26
+					$this->addIcon($icon);
27
+		}
27 28
 	}
28 29
 
29 30
 	/**
@@ -32,10 +33,11 @@  discard block
 block discarded – undo
32 33
 	 * @return HtmlLabel
33 34
 	 */
34 35
 	public function setPointing($value=Direction::NONE) {
35
-		if($value==="left" || $value==="right")
36
-			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
37
-		else
38
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
36
+		if($value==="left" || $value==="right") {
37
+					return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
38
+		} else {
39
+					return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
40
+		}
39 41
 	}
40 42
 
41 43
 	/**
@@ -129,10 +131,11 @@  discard block
 block discarded – undo
129 131
 	}
130 132
 
131 133
 	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
132
-		if($direction!==Direction::NONE)
133
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
134
-		else
135
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
134
+		if($direction!==Direction::NONE) {
135
+					return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
136
+		} else {
137
+					return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
138
+		}
136 139
 	}
137 140
 
138 141
 	public static function ribbon($identifier, $caption) {
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 1 patch
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,14 +15,15 @@  discard block
 block discarded – undo
15 15
 		$field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value);
16 16
 		$field->setProperty("name", $name);
17 17
 		$this->setField($field);
18
-		if (isset($label))
19
-			$this->setLabel($label);
18
+		if (isset($label)) {
19
+					$this->setLabel($label);
20
+		}
20 21
 	}
21 22
 
22 23
 	public function setChecked($value=true){
23 24
 		if($value===true){
24 25
 			$this->getField()->setProperty("checked", "checked");
25
-		}else{
26
+		} else{
26 27
 			$this->getField()->removeProperty("checked");
27 28
 		}
28 29
 		return $this;
@@ -51,8 +52,9 @@  discard block
 block discarded – undo
51 52
 	 * @return mixed
52 53
 	 */
53 54
 	public function getLabel() {
54
-		if (\array_key_exists("label", $this->content))
55
-			return $this->content["label"];
55
+		if (\array_key_exists("label", $this->content)) {
56
+					return $this->content["label"];
57
+		}
56 58
 	}
57 59
 
58 60
 	/**
@@ -127,8 +129,9 @@  discard block
 block discarded – undo
127 129
 	}
128 130
 
129 131
 	public function run(JsUtils $js) {
130
-		if(!isset($this->_bsComponent))
131
-			$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
132
+		if(!isset($this->_bsComponent)) {
133
+					$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
134
+		}
132 135
 		return parent::run($js);
133 136
 	}
134 137
 }
Please login to merge, or discard this patch.