Passed
Push — master ( 6cf655...807644 )
by Jean-Christophe
02:16
created
Ajax/semantic/html/elements/HtmlButtonGroups.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
 	protected $_dropdown;
19 19
 	public function __construct($identifier, $elements=array(), $asIcons=false) {
20 20
 		parent::__construct($identifier, "div", "ui buttons");
21
-		if ($asIcons === true)
22
-			$this->asIcons();
21
+		if ($asIcons === true) {
22
+					$this->asIcons();
23
+		}
23 24
 		$this->addElements($elements, $asIcons);
24 25
 	}
25 26
 	protected function createItem($value){
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
 	 */
51 52
 	public function addElement($element, $asIcon=false) {
52 53
 		$item=$this->addItem($element);
53
-		if($asIcon && $item instanceof HtmlButton)
54
-			$item->asIcon($element);
54
+		if($asIcon && $item instanceof HtmlButton) {
55
+					$item->asIcon($element);
56
+		}
55 57
 		return $item;
56 58
 	}
57 59
 
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 
80 82
 	public function asIcons() {
81 83
 		foreach ( $this->content as $item ) {
82
-			if($item instanceof HtmlButton)
83
-			$item->asIcon($item->getContent());
84
+			if($item instanceof HtmlButton) {
85
+						$item->asIcon($item->getContent());
86
+			}
84 87
 		}
85 88
 		return $this->addToProperty("class", "icons");
86 89
 	}
@@ -92,8 +95,9 @@  discard block
 block discarded – undo
92 95
 	 */
93 96
 	public function addIcons($icons){
94 97
 		foreach ( $this->content as $index=>$item ) {
95
-			if($item instanceof HtmlButton && isset($icons[$index]))
96
-				$item->addIcon($icons[$index]);
98
+			if($item instanceof HtmlButton && isset($icons[$index])) {
99
+							$item->addIcon($icons[$index]);
100
+			}
97 101
 		}
98 102
 		return $this;
99 103
 	}
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="") {
@@ -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/collections/form/traits/FormTrait.php 1 patch
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			foreach ($ajaxSubmit as $ajaxSubmitItem){
50 50
 				$compilation.=$ajaxSubmitItem->compile($js);
51 51
 			}
52
-		}elseif($ajaxSubmit instanceof AjaxCall){
52
+		} elseif($ajaxSubmit instanceof AjaxCall){
53 53
 			$compilation=$ajaxSubmit->compile($js);
54 54
 		}
55 55
 		$compilation=str_ireplace("\"","%quote%", $compilation);
@@ -67,8 +67,9 @@  discard block
 block discarded – undo
67 67
 
68 68
 	public function setAttached($value=true){
69 69
 		$form=$this->getForm();
70
-		if($value)
71
-			$form->addToPropertyCtrl("class", "attached", array ("attached" ));
70
+		if($value) {
71
+					$form->addToPropertyCtrl("class", "attached", array ("attached" ));
72
+		}
72 73
 		return $form;
73 74
 	}
74 75
 
@@ -90,10 +91,11 @@  discard block
 block discarded – undo
90 91
 	 */
91 92
 	public function submitOn($event,$identifierOrElement,$url,$responseElement,$parameters=NULL){
92 93
 		$form=$this->getForm();
93
-		if($identifierOrElement  instanceof BaseHtml)
94
-			$elem=$identifierOrElement;
95
-		else
96
-			$elem=$form->getElementById($identifierOrElement, $form->getContent());
94
+		if($identifierOrElement  instanceof BaseHtml) {
95
+					$elem=$identifierOrElement;
96
+		} else {
97
+					$elem=$form->getElementById($identifierOrElement, $form->getContent());
98
+		}
97 99
 		if(isset($elem)){
98 100
 			$this->_buttonAsSubmit($elem, $event,$url,$responseElement,$parameters);
99 101
 		}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataelement/DataElement.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,8 +123,9 @@
 block discarded – undo
123 123
 	}
124 124
 	
125 125
 	public function run(JsUtils $js){
126
-		if(JString::isNotNull($this->_identifier))
127
-			$js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});');
126
+		if(JString::isNotNull($this->_identifier)) {
127
+					$js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});');
128
+		}
128 129
 		parent::run($js);
129 130
 	}
130 131
 }
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 			foreach ($items as $k=>$v){
25 25
 				$this->addItem([$k,$v]);
26 26
 			}
27
-		}else{
27
+		} else{
28 28
 			foreach ($items as $item){
29 29
 				$this->addItem($item);
30 30
 			}
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 * @return \Ajax\common\html\HtmlDoubleElement
81 81
 	 */
82 82
 	public function getItem($index) {
83
-		if (is_int($index)&& isset($this->content[$index]))
84
-			return $this->content[$index];
85
-		else {
83
+		if (is_int($index)&& isset($this->content[$index])) {
84
+					return $this->content[$index];
85
+		} else {
86 86
 			$elm=$this->getElementById($index, $this->content);
87 87
 			return $elm;
88 88
 		}
@@ -144,10 +144,11 @@  discard block
 block discarded – undo
144 144
 		$i=0;
145 145
 		foreach ($properties as $k=>$v){
146 146
 			$c=$this->content[$i++];
147
-			if(isset($c))
148
-				$c->setProperty($k,$v);
149
-			else
150
-				return $this;
147
+			if(isset($c)) {
148
+							$c->setProperty($k,$v);
149
+			} else {
150
+							return $this;
151
+			}
151 152
 		}
152 153
 		return $this;
153 154
 	}
@@ -165,8 +166,7 @@  discard block
 block discarded – undo
165 166
 		foreach ($values as $i=>$value){
166 167
 			if(isset($this->content[$i])){
167 168
 				$this->content[$i]->setProperty($property,$value);
168
-			}
169
-			else{
169
+			} else{
170 170
 				return $this;
171 171
 			}
172 172
 		}
@@ -186,8 +186,7 @@  discard block
 block discarded – undo
186 186
 		foreach ($values as $i=>$value){
187 187
 			if(isset($this->content[$i])){
188 188
 				$this->content[$i++]->addToProperty($property,$value);
189
-			}
190
-			else{
189
+			} else{
191 190
 				return $this;
192 191
 			}
193 192
 		}
@@ -216,8 +215,9 @@  discard block
 block discarded – undo
216 215
 		foreach ( $this->content as $index=>$item ) {
217 216
 			if($item instanceof HtmlDoubleElement){
218 217
 				$href="";
219
-				if(isset($hrefs[$index]))
220
-					$href=$hrefs[$index];
218
+				if(isset($hrefs[$index])) {
219
+									$href=$hrefs[$index];
220
+				}
221 221
 				$item->asLink($href,$target);
222 222
 			}
223 223
 		}
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function getProperty($name) {
36
-		if (array_key_exists($name, $this->_self->properties))
37
-			return $this->_self->properties[$name];
36
+		if (array_key_exists($name, $this->_self->properties)) {
37
+					return $this->_self->properties[$name];
38
+		}
38 39
 	}
39 40
 
40 41
 	/**
@@ -76,8 +77,9 @@  discard block
 block discarded – undo
76 77
 	}
77 78
 
78 79
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
79
-		if (is_string($typeCtrl) && @class_exists($typeCtrl, true))
80
-			$typeCtrl=$typeCtrl::getConstants();
80
+		if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) {
81
+					$typeCtrl=$typeCtrl::getConstants();
82
+		}
81 83
 			if (\is_array($typeCtrl)) {
82 84
 				$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);
83 85
 			}
@@ -96,8 +98,9 @@  discard block
 block discarded – undo
96 98
 	}
97 99
 
98 100
 	public function removeProperty($name) {
99
-		if (\array_key_exists($name, $this->_self->properties))
100
-			unset($this->_self->properties[$name]);
101
+		if (\array_key_exists($name, $this->_self->properties)) {
102
+					unset($this->_self->properties[$name]);
103
+		}
101 104
 			return $this;
102 105
 	}
103 106
 
@@ -110,8 +113,9 @@  discard block
 block discarded – undo
110 113
 	}
111 114
 
112 115
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
113
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
114
-			return $this->_self->setProperty($name, $value);
116
+		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
117
+					return $this->_self->setProperty($name, $value);
118
+		}
115 119
 			return $this;
116 120
 	}
117 121
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/JsonDataTable.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@
 block discarded – undo
59 59
 			$callback.=$js->trigger("#".$id." [name='selection[]']","change",false)."$('#".$id." tbody .ui.checkbox').checkbox();".$js->execOn("change", "#".$id." [name='selection[]']", $this->_getCheckedChange($js));
60 60
 			$callback.=$this->_generatePaginationScript($id);
61 61
 			if(isset($this->_urls["refresh"])){
62
-				if(isset($menu))
63
-				$js->jsonArrayOn("click", "#".$menu->getIdentifier()." a","#".$this->_identifier." tr.".$this->_modelClass, $this->_urls["refresh"],"post",["params"=>"{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}","jsCallback"=>$callback]);
62
+				if(isset($menu)) {
63
+								$js->jsonArrayOn("click", "#".$menu->getIdentifier()." a","#".$this->_identifier." tr.".$this->_modelClass, $this->_urls["refresh"],"post",["params"=>"{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}","jsCallback"=>$callback]);
64
+				}
64 65
 			}
65 66
 		}
66 67
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,8 +79,9 @@  discard block
 block discarded – undo
79 79
 		$actionO=$action;
80 80
 		if (\is_object($action) === false) {
81 81
 			$actionO=new HtmlButton("action-" . $this->identifier, $action);
82
-			if (isset($icon))
83
-				$actionO->addIcon($icon, true, $labeled);
82
+			if (isset($icon)) {
83
+							$actionO->addIcon($icon, true, $labeled);
84
+			}
84 85
 		}
85 86
 		$field->addToProperty("class", $direction . " action");
86 87
 		$field->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
@@ -120,8 +121,9 @@  discard block
 block discarded – undo
120 121
 
121 122
 	public function setDisabled($disable=true) {
122 123
 		$field=$this->getField();
123
-		if($disable)
124
-			$field->addToProperty("class", "disabled");
124
+		if($disable) {
125
+					$field->addToProperty("class", "disabled");
126
+		}
125 127
 		return $this;
126 128
 	}
127 129
 	
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldsTrait.php 1 patch
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,11 +29,12 @@  discard block
 block discarded – undo
29 29
 		if(\is_array($value)){
30 30
 			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
31 31
 			return $itemO;
32
-		}elseif(\is_object($value)){
32
+		} elseif(\is_object($value)){
33 33
 			$itemO=new HtmlFormField("field-".$this->identifier, $value);
34 34
 			return $itemO;
35
-		}else
36
-			return new HtmlFormInput($value);
35
+		} else {
36
+					return new HtmlFormInput($value);
37
+		}
37 38
 	}
38 39
 
39 40
 	protected function createCondition($value){
@@ -67,8 +68,7 @@  discard block
 block discarded – undo
67 68
 			if(isset($c)){
68 69
 				$df=$c->getDataField();
69 70
 				$df->setProperty($property,$value);
70
-			}
71
-			else{
71
+			} else{
72 72
 				return $this;
73 73
 			}
74 74
 		}
@@ -163,10 +163,12 @@  discard block
 block discarded – undo
163 163
 	public function addButtonIcon($identifier,$icon,$cssStyle=NULL,$onClick=NULL){
164 164
 		$bt=new HtmlButton($identifier);
165 165
 		$bt->asIcon($icon);
166
-		if(isset($onClick))
167
-			$bt->onClick($onClick);
168
-		if (isset($cssStyle))
169
-			$bt->addClass($cssStyle);
166
+		if(isset($onClick)) {
167
+					$bt->onClick($onClick);
168
+		}
169
+		if (isset($cssStyle)) {
170
+					$bt->addClass($cssStyle);
171
+		}
170 172
 		return $this->addItem($bt);
171 173
 	}
172 174
 
Please login to merge, or discard this patch.