Completed
Push — master ( e53430...e06bda )
by Jean-Christophe
03:13
created
Ajax/semantic/widgets/base/FieldAsTrait.php 1 patch
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
 			$rules=$attributes["rules"];
63 63
 			if(\is_array($rules)){
64 64
 				$element->addRules($rules);
65
-			}
66
-			else{
65
+			} else{
67 66
 				$element->addRule($rules);
68 67
 			}
69 68
 			unset($attributes["rules"]);
@@ -123,8 +122,9 @@  discard block
 block discarded – undo
123 122
 	public function fieldAsHeader($index,$niveau=1,$icon=NULL,$attributes=NULL){
124 123
 		return $this->_fieldAs(function($id,$name,$value) use($niveau,$icon){
125 124
 			$header=new HtmlHeader($id,$niveau,$value);
126
-			if(isset($icon))
127
-				$header->asIcon($icon, $value);
125
+			if(isset($icon)) {
126
+							$header->asIcon($icon, $value);
127
+			}
128 128
 			return $header;
129 129
 		}, $index,$attributes,"header");
130 130
 	}
@@ -132,7 +132,9 @@  discard block
 block discarded – undo
132 132
 
133 133
 	public function fieldAsImage($index,$size=Size::MINI,$circular=false){
134 134
 		$this->setValueFunction($index,function($img) use($size,$circular){
135
-			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular();
135
+			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) {
136
+				$image->setCircular();
137
+			}
136 138
 			return $image;
137 139
 		});
138 140
 			return $this;
@@ -221,14 +223,14 @@  discard block
 block discarded – undo
221 223
 		$i=0;
222 224
 		if(JArray::isAssociative($types)){
223 225
 			foreach ($types as $type=>$attributes){
224
-				if(\is_int($type))
225
-					$this->fieldAs($i++,$attributes,[]);
226
-				else{
226
+				if(\is_int($type)) {
227
+									$this->fieldAs($i++,$attributes,[]);
228
+				} else{
227 229
 					$type=preg_replace('/\d/', '', $type );
228 230
 					$this->fieldAs($i++,$type,$attributes);
229 231
 				}
230 232
 			}
231
-		}else{
233
+		} else{
232 234
 			foreach ($types as $type){
233 235
 				$this->fieldAs($i++,$type);
234 236
 			}
@@ -240,7 +242,7 @@  discard block
 block discarded – undo
240 242
 		if(\method_exists($this, $method)){
241 243
 			if(!\is_array($attributes)){
242 244
 				$attributes=[$index];
243
-			}else{
245
+			} else{
244 246
 				\array_unshift($attributes, $index);
245 247
 			}
246 248
 			\call_user_func_array([$this,$method], $attributes);
Please login to merge, or discard this patch.