Passed
Push — master ( 858380...1fb59e )
by Jean-Christophe
01:48
created
Ajax/semantic/traits/SemanticHtmlCollectionsTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @param int $colCount
23 23
 	 * @return HtmlTable
24 24
 	 */
25
-	public function htmlTable($identifier, $rowCount, $colCount){
25
+	public function htmlTable($identifier, $rowCount, $colCount) {
26 26
 		return $this->addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount));
27 27
 	}
28 28
 
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	 * @param $styles string|array|NULL
34 34
 	 * @return HtmlMessage
35 35
 	 */
36
-	public function htmlMessage($identifier, $content="",$styles=NULL) {
37
-		$msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content));
38
-		if(isset($msg) && $styles!==null)
36
+	public function htmlMessage($identifier, $content="", $styles=NULL) {
37
+		$msg=$this->addHtmlComponent(new HtmlMessage($identifier, $content));
38
+		if (isset($msg) && $styles!==null)
39 39
 			$msg->setStyle($styles);
40 40
 		return $msg;
41 41
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@
 block discarded – undo
35 35
 	 */
36 36
 	public function htmlMessage($identifier, $content="",$styles=NULL) {
37 37
 		$msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content));
38
-		if(isset($msg) && $styles!==null)
39
-			$msg->setStyle($styles);
38
+		if(isset($msg) && $styles!==null) {
39
+					$msg->setStyle($styles);
40
+		}
40 41
 		return $msg;
41 42
 	}
42 43
 
Please login to merge, or discard this patch.
Ajax/semantic/components/Dropdown.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 	 * @param string $action one of "select","auto","activate","combo","nothing","hide"
17 17
 	 * @return \Ajax\semantic\components\Dropdown
18 18
 	 */
19
-	public function setAction($action){
20
-		return $this->setParamCtrl("action", $action,array("select","auto","activate","combo","nothing","hide"));
19
+	public function setAction($action) {
20
+		return $this->setParamCtrl("action", $action, array("select", "auto", "activate", "combo", "nothing", "hide"));
21 21
 	}
22 22
 
23 23
 	/**
@@ -25,23 +25,23 @@  discard block
 block discarded – undo
25 25
 	 * @param string $event Event used to trigger dropdown (Hover, Click, Custom Event)
26 26
 	 * @return \Ajax\semantic\components\Dropdown
27 27
 	 */
28
-	public function setOn($event){
28
+	public function setOn($event) {
29 29
 		return $this->setParam("on", $event);
30 30
 	}
31 31
 
32
-	public function setFullTextSearch($value){
32
+	public function setFullTextSearch($value) {
33 33
 		return $this->setParam("fullTextSearch", $value);
34 34
 	}
35 35
 
36
-	public function setShowOnFocus($value){
36
+	public function setShowOnFocus($value) {
37 37
 		return $this->setParam("showOnFocus", $value);
38 38
 	}
39 39
 	
40
-	public function setAllowAdditions($value){
40
+	public function setAllowAdditions($value) {
41 41
 		return $this->setParam("allowAdditions", $value);
42 42
 	}
43 43
 	
44
-	public function setClearable($value){
44
+	public function setClearable($value) {
45 45
 		return $this->setParam("clearable", $value);
46 46
 	}
47 47
 }
Please login to merge, or discard this patch.
Ajax/common/BaseGui.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 
29 29
 	public function __construct($autoCompile=true) {
30 30
 		$this->autoCompile=$autoCompile;
31
-		$this->components=array ();
32
-		$this->htmlComponents=array ();
31
+		$this->components=array();
32
+		$this->htmlComponents=array();
33 33
 	}
34 34
 
35 35
 	public function isAutoCompile() {
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function compile($internal=false) {
45
-		if ($internal===false&&$this->autoCompile===true)
45
+		if ($internal===false && $this->autoCompile===true)
46 46
 			throw new \Exception("Impossible to compile if autoCompile is set to 'true'");
47
-		foreach ( $this->components as $component ) {
47
+		foreach ($this->components as $component) {
48 48
 			$component->compile();
49 49
 		}
50 50
 	}
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 	}
55 55
 
56 56
 	public function addComponent(SimpleComponent $component, $attachTo, $params) {
57
-		if ($this->autoCompile){
58
-			if($attachTo!=null){
59
-				if(!isset($this->components [$attachTo])){
57
+		if ($this->autoCompile) {
58
+			if ($attachTo!=null) {
59
+				if (!isset($this->components [$attachTo])) {
60 60
 					$this->components [$attachTo]=$component;
61 61
 				}
62 62
 				$component->attach($attachTo);
63
-			}else{
63
+			} else {
64 64
 				$this->components []=$component;
65 65
 			}
66 66
 		}
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 
78 78
 	public function compileHtml(JsUtils $js=NULL, &$view=NULL) {
79
-		foreach ( $this->htmlComponents as $htmlComponent ) {
79
+		foreach ($this->htmlComponents as $htmlComponent) {
80 80
 			$htmlComponent->compile($js, $view);
81 81
 		}
82 82
 	}
83 83
 	
84
-	public function matchHtmlComponents($callback){
85
-		return array_filter($this->htmlComponents,$callback);
84
+	public function matchHtmlComponents($callback) {
85
+		return array_filter($this->htmlComponents, $callback);
86 86
 	}
87 87
 }
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function compile($internal=false) {
45
-		if ($internal===false&&$this->autoCompile===true)
46
-			throw new \Exception("Impossible to compile if autoCompile is set to 'true'");
45
+		if ($internal===false&&$this->autoCompile===true) {
46
+					throw new \Exception("Impossible to compile if autoCompile is set to 'true'");
47
+		}
47 48
 		foreach ( $this->components as $component ) {
48 49
 			$component->compile();
49 50
 		}
@@ -60,13 +61,14 @@  discard block
 block discarded – undo
60 61
 					$this->components [$attachTo]=$component;
61 62
 				}
62 63
 				$component->attach($attachTo);
63
-			}else{
64
+			} else{
64 65
 				$this->components []=$component;
65 66
 			}
66 67
 		}
67
-		if (isset($params))
68
-			if (\is_array($params))
68
+		if (isset($params)) {
69
+					if (\is_array($params))
69 70
 				$component->setParams($params);
71
+		}
70 72
 		return $component;
71 73
 	}
72 74
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  */
24 24
 class HtmlForm extends HtmlSemCollection {
25 25
 
26
-	use FieldsTrait,FormTrait;
26
+	use FieldsTrait, FormTrait;
27 27
 	/**
28 28
 	 * @var array
29 29
 	 */
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 
39 39
 	public function __construct($identifier, $elements=array()) {
40 40
 		parent::__construct($identifier, "form", "ui form");
41
-		$this->_states=[ State::ERROR,State::SUCCESS,State::WARNING,State::DISABLED ];
41
+		$this->_states=[State::ERROR, State::SUCCESS, State::WARNING, State::DISABLED];
42 42
 		$this->setProperty("name", $this->identifier);
43
-		$this->_fields=array ();
43
+		$this->_fields=array();
44 44
 		$this->addItems($elements);
45 45
 		$this->_validationParams=[];
46 46
 		$this->_extraFieldRules=[];
47 47
 	}
48 48
 
49
-	protected function getForm(){
49
+	protected function getForm() {
50 50
 		return $this;
51 51
 	}
52 52
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 * @param string $caption
69 69
 	 * @return HtmlForm
70 70
 	 */
71
-	public function addDivider($caption=NULL){
72
-		return $this->addContent(new HtmlDivider("",$caption));
71
+	public function addDivider($caption=NULL) {
72
+		return $this->addContent(new HtmlDivider("", $caption));
73 73
 	}
74 74
 
75 75
 	/**
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
 						$label=NULL;
92 92
 				}
93 93
 				$this->_fields=\array_merge($this->_fields, $fields);
94
-				$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields);
94
+				$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count(), $fields);
95 95
 			}
96
-			if (isset($label)){
97
-				$fields->wrap("<div class='field'><label>{$label}</label>","</div>");
96
+			if (isset($label)) {
97
+				$fields->wrap("<div class='field'><label>{$label}</label>", "</div>");
98 98
 			}
99 99
 		} else {
100
-			$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count());
100
+			$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count());
101 101
 		}
102 102
 		$this->addItem($fields);
103 103
 		return $fields;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 	public function addItem($item) {
107 107
 		$item=parent::addItem($item);
108
-		if (\is_subclass_of($item, HtmlFormField::class) === true) {
108
+		if (\is_subclass_of($item, HtmlFormField::class)===true) {
109 109
 			$this->_fields[]=$item;
110 110
 		}
111 111
 		return $item;
@@ -163,49 +163,49 @@  discard block
 block discarded – undo
163 163
 
164 164
 
165 165
 
166
-	public function compile(JsUtils $js=NULL,&$view=NULL){
167
-		if(\sizeof($this->_validationParams)>0)
166
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
167
+		if (\sizeof($this->_validationParams)>0)
168 168
 			$this->setProperty("novalidate", "");
169
-		return parent::compile($js,$view);
169
+		return parent::compile($js, $view);
170 170
 	}
171 171
 
172 172
 	public function run(JsUtils $js) {
173
-		if(isset($js)){
173
+		if (isset($js)) {
174 174
 			$compo=$js->semantic()->form("#".$this->identifier);
175
-		}else{
175
+		} else {
176 176
 			$compo=new Form();
177 177
 			$compo->attach("#".$this->identifier);
178 178
 		}
179
-		foreach ($this->_fields as $field){
180
-			if($field instanceof HtmlFormField){
179
+		foreach ($this->_fields as $field) {
180
+			if ($field instanceof HtmlFormField) {
181 181
 				$this->addCompoValidation($compo, $field);
182 182
 			}
183 183
 		}
184
-		foreach ($this->content as $field){
185
-			if($field instanceof HtmlFormFields){
184
+		foreach ($this->content as $field) {
185
+			if ($field instanceof HtmlFormFields) {
186 186
 				$items=$field->getItems();
187
-				foreach ($items as $_field){
188
-					if($_field instanceof HtmlFormField)
187
+				foreach ($items as $_field) {
188
+					if ($_field instanceof HtmlFormField)
189 189
 						$this->addCompoValidation($compo, $_field);
190 190
 				}
191 191
 			}
192 192
 		}
193
-		foreach ($this->_extraFieldRules as $field=>$fieldValidation){
193
+		foreach ($this->_extraFieldRules as $field=>$fieldValidation) {
194 194
 			$this->addExtraCompoValidation($compo, $fieldValidation);
195 195
 		}
196
-		$this->_runValidationParams($compo,$js);
196
+		$this->_runValidationParams($compo, $js);
197 197
 		return $this->_bsComponent;
198 198
 	}
199 199
 	
200
-	public function getExtraFieldValidation($fieldname){
201
-		if(!isset($this->_extraFieldRules[$fieldname])){
200
+	public function getExtraFieldValidation($fieldname) {
201
+		if (!isset($this->_extraFieldRules[$fieldname])) {
202 202
 			$this->_extraFieldRules[$fieldname]=new FieldValidation($fieldname);
203 203
 		}
204 204
 		return $this->_extraFieldRules[$fieldname];
205 205
 	}
206 206
 
207
-	public function addValidationParam($paramName,$paramValue,$before="",$after=""){
208
-		$this->addBehavior($this->_validationParams, $paramName, $paramValue,$before,$after);
207
+	public function addValidationParam($paramName, $paramValue, $before="", $after="") {
208
+		$this->addBehavior($this->_validationParams, $paramName, $paramValue, $before, $after);
209 209
 		return $this;
210 210
 	}
211 211
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		return $this;
215 215
 	}
216 216
 	
217
-	public function hasValidationParams(){
217
+	public function hasValidationParams() {
218 218
 		return sizeof($this->_validationParams)>0;
219 219
 	}
220 220
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		return $this->_validationParams;
223 223
 	}
224 224
 
225
-	public function removeValidationParam($param){
225
+	public function removeValidationParam($param) {
226 226
 		unset($this->_validationParams[$param]);
227 227
 		return $this;
228 228
 	}
Please login to merge, or discard this patch.
Braces   +22 added lines, -15 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function addHeader($title, $niveau=1, $dividing=true) {
60 60
 		$header=new HtmlHeader("", $niveau, $title);
61
-		if ($dividing)
62
-			$header->setDividing();
61
+		if ($dividing) {
62
+					$header->setDividing();
63
+		}
63 64
 		return $this->addItem($header);
64 65
 	}
65 66
 
@@ -87,8 +88,9 @@  discard block
 block discarded – undo
87 88
 					if (\is_string($end)) {
88 89
 						$label=$end;
89 90
 						\array_pop($fields);
90
-					} else
91
-						$label=NULL;
91
+					} else {
92
+											$label=NULL;
93
+					}
92 94
 				}
93 95
 				$this->_fields=\array_merge($this->_fields, $fields);
94 96
 				$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields);
@@ -152,27 +154,31 @@  discard block
 block discarded – undo
152 154
 	 */
153 155
 	public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) {
154 156
 		$message=new HtmlMessage($identifier, $content);
155
-		if (isset($header))
156
-			$message->addHeader($header);
157
-		if (isset($icon))
158
-			$message->setIcon($icon);
159
-		if (isset($type))
160
-			$message->setStyle($type);
157
+		if (isset($header)) {
158
+					$message->addHeader($header);
159
+		}
160
+		if (isset($icon)) {
161
+					$message->setIcon($icon);
162
+		}
163
+		if (isset($type)) {
164
+					$message->setStyle($type);
165
+		}
161 166
 		return $this->addItem($message);
162 167
 	}
163 168
 
164 169
 
165 170
 
166 171
 	public function compile(JsUtils $js=NULL,&$view=NULL){
167
-		if(\sizeof($this->_validationParams)>0)
168
-			$this->setProperty("novalidate", "");
172
+		if(\sizeof($this->_validationParams)>0) {
173
+					$this->setProperty("novalidate", "");
174
+		}
169 175
 		return parent::compile($js,$view);
170 176
 	}
171 177
 
172 178
 	public function run(JsUtils $js) {
173 179
 		if(isset($js)){
174 180
 			$compo=$js->semantic()->form("#".$this->identifier);
175
-		}else{
181
+		} else{
176 182
 			$compo=new Form();
177 183
 			$compo->attach("#".$this->identifier);
178 184
 		}
@@ -185,8 +191,9 @@  discard block
 block discarded – undo
185 191
 			if($field instanceof HtmlFormFields){
186 192
 				$items=$field->getItems();
187 193
 				foreach ($items as $_field){
188
-					if($_field instanceof HtmlFormField)
189
-						$this->addCompoValidation($compo, $_field);
194
+					if($_field instanceof HtmlFormField) {
195
+											$this->addCompoValidation($compo, $_field);
196
+					}
190 197
 				}
191 198
 			}
192 199
 		}
Please login to merge, or discard this patch.