Completed
Push — master ( 667888...aa0ebb )
by Jean-Christophe
03:27
created
Ajax/semantic/widgets/dataform/FormFieldAsTrait.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,10 +43,11 @@  discard block
 block discarded – undo
43 43
 	protected function _addRules($element,$attributes){
44 44
 		if(isset($attributes["rules"])){
45 45
 			$rules=$attributes["rules"];
46
-			if(\is_array($rules))
47
-				$element->addRules($rules);
48
-				else
49
-					$element->addRule($rules);
46
+			if(\is_array($rules)) {
47
+							$element->addRules($rules);
48
+			} else {
49
+									$element->addRule($rules);
50
+				}
50 51
 				unset($attributes["rules"]);
51 52
 		}
52 53
 	}
@@ -56,8 +57,9 @@  discard block
 block discarded – undo
56 57
 			$caption=$this->_instanceViewer->getCaption($index);
57 58
 			$name=$this->_instanceViewer->getFieldName($index);
58 59
 			$element=$elementCallback($name,$caption,$value);
59
-			if(\is_array($attributes))
60
-				$this->_applyAttributes($element, $attributes,$index);
60
+			if(\is_array($attributes)) {
61
+							$this->_applyAttributes($element, $attributes,$index);
62
+			}
61 63
 			return $element;
62 64
 		});
63 65
 			return $this;
Please login to merge, or discard this patch.
Ajax/semantic/widgets/base/FieldAsTrait.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 				$name=$attributes["name"];
35 35
 			}
36 36
 			$element=$elementCallback($this->_getFieldIdentifier($prefix),$value,$name);
37
-			if(\is_array($attributes))
38
-				$this->_applyAttributes($element, $attributes,$index);
37
+			if(\is_array($attributes)) {
38
+							$this->_applyAttributes($element, $attributes,$index);
39
+			}
39 40
 			return $element;
40 41
 		});
41 42
 			return $this;
@@ -68,7 +69,9 @@  discard block
 block discarded – undo
68 69
 
69 70
 	public function fieldAsImage($index,$size=Size::SMALL,$circular=false){
70 71
 		$this->setValueFunction($index,function($img) use($size,$circular){
71
-			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular();
72
+			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) {
73
+				$image->setCircular();
74
+			}
72 75
 			return $image;
73 76
 		});
74 77
 			return $this;
Please login to merge, or discard this patch.