Passed
Push — master ( 8b697d...525a36 )
by Jean-Christophe
01:54
created
Ajax/semantic/html/collections/form/HtmlFormFields.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 		if (isset($label))
37 37
 			$this->setLabel($label);
38
-		foreach ( $fields as $field ) {
38
+		foreach ($fields as $field) {
39 39
 			$this->addItem($field);
40 40
 		}
41 41
 		return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addItem($item) {
59 59
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
60
+		if ($item instanceof HtmlFormField)
61 61
 			$item->setContainer($this);
62 62
 		return $item;
63 63
 	}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	/**
66 66
 	 * @return HtmlFormField
67 67
 	 */
68
-	public function getItem($index){
68
+	public function getItem($index) {
69 69
 		return parent::getItem($index);
70 70
 	}
71 71
 
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
 	}
105 105
 
106 106
 
107
-	public static function radios($identifier,$name, $items=array(), $label=NULL, $value=null, $type=NULL) {
108
-		$fields=array ();
107
+	public static function radios($identifier, $name, $items=array(), $label=NULL, $value=null, $type=NULL) {
108
+		$fields=array();
109 109
 		$i=0;
110
-		foreach ( $items as $val => $caption ) {
110
+		foreach ($items as $val => $caption) {
111 111
 			$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
112 112
 			if ($val===$value) {
113 113
 				$itemO->getDataField()->setProperty("checked", "");
@@ -115,19 +115,19 @@  discard block
 block discarded – undo
115 115
 			$fields[]=$itemO;
116 116
 		}
117 117
 		$radios=new HtmlFormFields($identifier, $fields);
118
-		if (isset($label)){
118
+		if (isset($label)) {
119 119
 			$lbl=$radios->setLabel($label);
120
-			if($lbl instanceof HtmlSemDoubleElement){
120
+			if ($lbl instanceof HtmlSemDoubleElement) {
121 121
 				$lbl->setProperty("for", $name);
122 122
 			}
123 123
 		}
124 124
 		return $radios;
125 125
 	}
126 126
 
127
-	public static function checkeds($identifier,$name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
128
-		$fields=array ();
127
+	public static function checkeds($identifier, $name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
128
+		$fields=array();
129 129
 		$i=0;
130
-		foreach ( $items as $val => $caption ) {
130
+		foreach ($items as $val => $caption) {
131 131
 			$itemO=new HtmlFormCheckbox($name."-".$i++, $caption, $val, $type);
132 132
 			$itemO->setName($name);
133 133
 			if (\array_search($val, $values)!==false) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		return $this;
147 147
 	}
148 148
 	
149
-	public function run(JsUtils $js){
149
+	public function run(JsUtils $js) {
150 150
 		return parent::run($js);
151 151
 		//return $result->setItemSelector("[data-value]");
152 152
 	}
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,12 +29,14 @@  discard block
 block discarded – undo
29 29
 				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				} else
33
-					$label=NULL;
32
+				} else {
33
+									$label=NULL;
34
+				}
34 35
 			}
35 36
 		}
36
-		if (isset($label))
37
-			$this->setLabel($label);
37
+		if (isset($label)) {
38
+					$this->setLabel($label);
39
+		}
38 40
 		foreach ( $fields as $field ) {
39 41
 			$this->addItem($field);
40 42
 		}
@@ -57,8 +59,9 @@  discard block
 block discarded – undo
57 59
 
58 60
 	public function addItem($item) {
59 61
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
61
-			$item->setContainer($this);
62
+		if($item instanceof HtmlFormField) {
63
+					$item->setContainer($this);
64
+		}
62 65
 		return $item;
63 66
 	}
64 67
 	
@@ -73,8 +76,9 @@  discard block
 block discarded – undo
73 76
 		if ($this->_equalWidth) {
74 77
 			$count=$this->count();
75 78
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
76
-		} else
77
-			$this->addToProperty("class", "fields");
79
+		} else {
80
+					$this->addToProperty("class", "fields");
81
+		}
78 82
 		return parent::compile($js, $view);
79 83
 	}
80 84
 
@@ -136,8 +140,9 @@  discard block
 block discarded – undo
136 140
 			$fields[]=$itemO;
137 141
 		}
138 142
 		$radios=new HtmlFormFields($identifier, $fields);
139
-		if (isset($label))
140
-			$radios->setLabel($label)->setProperty("for", $name);
143
+		if (isset($label)) {
144
+					$radios->setLabel($label)->setProperty("for", $name);
145
+		}
141 146
 		return $radios;
142 147
 	}
143 148
 
Please login to merge, or discard this patch.