Passed
Push — master ( f6786e...e756b0 )
by Jean-Christophe
01:42
created
Ajax/semantic/html/modules/HtmlModal.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
 			foreach ($actions as $action){
44 44
 				$this->addAction($action);
45 45
 			}
46
-		}
47
-		else{
46
+		} else{
48 47
 			$this->addAction($actions);
49 48
 		}
50 49
 		return $this;
@@ -64,8 +63,9 @@  discard block
 block discarded – undo
64 63
 				$class="cancel";
65 64
 			}
66 65
 			$action=new HtmlButton("action-".$this->identifier."-".JArray::count($this->content["actions"]->getContent()),$action);
67
-			if($class!=="")
68
-				$action->addToProperty("class", $class);
66
+			if($class!=="") {
67
+							$action->addToProperty("class", $class);
68
+			}
69 69
 		}
70 70
 		return $this->addElementInPart($action, "actions");
71 71
 	}
@@ -174,8 +174,9 @@  discard block
 block discarded – undo
174 174
 	 * @see BaseHtml::run()
175 175
 	 */
176 176
 	public function run(JsUtils $js) {
177
-		if(isset($this->_bsComponent)===false)
178
-			$this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts);
177
+		if(isset($this->_bsComponent)===false) {
178
+					$this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts);
179
+		}
179 180
 		$this->addEventsOnRun($js);
180 181
 		return $this->_bsComponent;
181 182
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
24 24
 		parent::__construct($identifier, $tagName, "ui label");
25 25
 		$this->content=$caption;
26
-		if (isset($icon))
27
-			$this->addIcon($icon);
26
+		if (isset($icon)) {
27
+					$this->addIcon($icon);
28
+		}
28 29
 	}
29 30
 
30 31
 	/**
@@ -33,10 +34,11 @@  discard block
 block discarded – undo
33 34
 	 * @return HtmlLabel
34 35
 	 */
35 36
 	public function setPointing($value=Direction::NONE) {
36
-		if($value==="left" || $value==="right")
37
-			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
38
-		else
39
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
37
+		if($value==="left" || $value==="right") {
38
+					return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
39
+		} else {
40
+					return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
41
+		}
40 42
 	}
41 43
 
42 44
 	/**
@@ -134,10 +136,11 @@  discard block
 block discarded – undo
134 136
 	}
135 137
 
136 138
 	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
137
-		if($direction!==Direction::NONE)
138
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
139
-		else
140
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
139
+		if($direction!==Direction::NONE) {
140
+					return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
141
+		} else {
142
+					return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
143
+		}
141 144
 	}
142 145
 
143 146
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,16 +25,17 @@
 block discarded – undo
25 25
 			if(isset($title)){
26 26
 				$this->setTitle($title,$desc);
27 27
 			}
28
-		}else{
28
+		} else{
29 29
 			$this->setContent($content);
30 30
 		}
31 31
 	}
32 32
 
33 33
 	public function setActive($value=true){
34
-		if($value)
35
-			$this->setStatus(StepStatus::ACTIVE);
36
-		else
37
-			$this->setStatus(StepStatus::NONE);
34
+		if($value) {
35
+					$this->setStatus(StepStatus::ACTIVE);
36
+		} else {
37
+					$this->setStatus(StepStatus::NONE);
38
+		}
38 39
 		return $this;
39 40
 	}
40 41
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,8 +24,9 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public function removeIcon(){
27
-		if(isset($this->content["icon"]))
28
-			unset($this->content["icon"]);
27
+		if(isset($this->content["icon"])) {
28
+					unset($this->content["icon"]);
29
+		}
29 30
 		return $this;
30 31
 	}
31 32
 
@@ -77,7 +78,7 @@  discard block
 block discarded – undo
77 78
 			$this->setTagName("div");
78 79
 			$this->removeProperty("href");
79 80
 			$this->addToPropertyCtrl("class", "active", array("active"));
80
-		}else{
81
+		} else{
81 82
 			$this->removePropertyValue("class", "active");
82 83
 		}
83 84
 		return $this;
@@ -85,8 +86,9 @@  discard block
 block discarded – undo
85 86
 
86 87
 	public function asLink($href=NULL,$part=NULL){
87 88
 		$this->setTagName("a");
88
-		if(isset($href))
89
-			$this->setProperty("href", $href);
89
+		if(isset($href)) {
90
+					$this->setProperty("href", $href);
91
+		}
90 92
 		return $this;
91 93
 	}
92 94
 
@@ -97,8 +99,9 @@  discard block
 block discarded – undo
97 99
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
98 100
 	 */
99 101
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
100
-		if(\is_array($this->content) && JArray::isAssociative($this->content))
101
-			$this->content=JArray::sortAssociative($this->content, [ "right-content","icon","image","content" ]);
102
+		if(\is_array($this->content) && JArray::isAssociative($this->content)) {
103
+					$this->content=JArray::sortAssociative($this->content, [ "right-content","icon","image","content" ]);
104
+		}
102 105
 		return parent::compile($js, $view);
103 106
 	}
104 107
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 1 patch
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,14 +15,15 @@  discard block
 block discarded – undo
15 15
 		$field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value);
16 16
 		$field->setProperty("name", $name);
17 17
 		$this->setField($field);
18
-		if (isset($label))
19
-			$this->setLabel($label,$value);
18
+		if (isset($label)) {
19
+					$this->setLabel($label,$value);
20
+		}
20 21
 	}
21 22
 
22 23
 	public function setChecked($value=true){
23 24
 		if($value===true){
24 25
 			$this->getField()->setProperty("checked", "checked");
25
-		}else{
26
+		} else{
26 27
 			$this->getField()->removeProperty("checked");
27 28
 		}
28 29
 		return $this;
@@ -38,8 +39,9 @@  discard block
 block discarded – undo
38 39
 			$labelO=new HtmlSemDoubleElement("", "label", "");
39 40
 			$labelO->setContent($label);
40 41
 			$labelO->setProperty("for", $this->getField()->getIdentifier());
41
-			if(isset($value))
42
-				$labelO->setProperty("data-value", $value);
42
+			if(isset($value)) {
43
+							$labelO->setProperty("data-value", $value);
44
+			}
43 45
 		}
44 46
 		$this->content["label"]=$labelO;
45 47
 	}
@@ -53,8 +55,9 @@  discard block
 block discarded – undo
53 55
 	 * @return mixed
54 56
 	 */
55 57
 	public function getLabel() {
56
-		if (\array_key_exists("label", $this->content))
57
-			return $this->content["label"];
58
+		if (\array_key_exists("label", $this->content)) {
59
+					return $this->content["label"];
60
+		}
58 61
 	}
59 62
 
60 63
 	/**
@@ -129,8 +132,9 @@  discard block
 block discarded – undo
129 132
 	}
130 133
 
131 134
 	public function run(JsUtils $js) {
132
-		if(!isset($this->_bsComponent))
133
-			$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
135
+		if(!isset($this->_bsComponent)) {
136
+					$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
137
+		}
134 138
 		return parent::run($js);
135 139
 	}
136 140
 }
Please login to merge, or discard this patch.
Ajax/ui/components/DialogButton.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 class DialogButton extends BaseComponent {
15 15
 
16 16
 	private function addFunction($jsCode) {
17
-		if (!JString::startsWith($jsCode, "function"))
18
-			$jsCode="%function(){" . $jsCode . "}%";
17
+		if (!JString::startsWith($jsCode, "function")) {
18
+					$jsCode="%function(){" . $jsCode . "}%";
19
+		}
19 20
 		return $jsCode;
20 21
 	}
21 22
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlDropdown.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	public function addItem($caption, $href="#") {
91 91
 		if($caption instanceof HtmlDropdownItem){
92 92
 			$item=$caption;
93
-		}else{
93
+		} else{
94 94
 			$iid=$this->getItemsCount()+1;
95 95
 			$item=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid);
96 96
 			$item->setCaption($caption)->setHref($href);
@@ -130,10 +130,11 @@  discard block
 block discarded – undo
130 130
 	 * @see BaseHtml::fromArray()
131 131
 	 */
132 132
 	public function fromArray($array) {
133
-		if (array_keys($array)!==range(0, count($array)-1))
134
-			return parent::fromArray($array);
135
-		else
136
-			return $this->addItems($array);
133
+		if (array_keys($array)!==range(0, count($array)-1)) {
134
+					return parent::fromArray($array);
135
+		} else {
136
+					return $this->addItems($array);
137
+		}
137 138
 	}
138 139
 
139 140
 	public function setItems($items) {
@@ -186,8 +187,9 @@  discard block
 block discarded – undo
186 187
 	 * @see BaseHtml::setTagName()
187 188
 	 */
188 189
 	public function setTagName($tagName) {
189
-		if ($tagName=="button")
190
-			$this->class="btn dropdown-toggle";
190
+		if ($tagName=="button") {
191
+					$this->class="btn dropdown-toggle";
192
+		}
191 193
 		return parent::setTagName($tagName);
192 194
 	}
193 195
 
@@ -205,8 +207,9 @@  discard block
 block discarded – undo
205 207
 	}
206 208
 
207 209
 	public function setAlignment($alignment) {
208
-		if (is_int($alignment))
209
-			$alignment="dropdown-menu-".CssRef::alignment()[$alignment];
210
+		if (is_int($alignment)) {
211
+					$alignment="dropdown-menu-".CssRef::alignment()[$alignment];
212
+		}
210 213
 		return $this->addToMemberCtrl($this->class, $alignment, CssRef::alignment());
211 214
 	}
212 215
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPagination.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
 		$this->from=$from;
53 53
 		$this->to=$to;
54 54
 		$this->urlMask="%page%";
55
-		if(!isset($countVisible))
56
-			$this->countVisible=$to-$from+1;
57
-		else
58
-			$this->countVisible=$countVisible;
55
+		if(!isset($countVisible)) {
56
+					$this->countVisible=$to-$from+1;
57
+		} else {
58
+					$this->countVisible=$countVisible;
59
+		}
59 60
 		$this->createContent();
60 61
 	}
61 62
 
@@ -74,7 +75,7 @@  discard block
 block discarded – undo
74 75
 			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
75 76
 			$href->setProperty($this->attr, $url);
76 77
 			$elem->setContent($href);
77
-		}else{
78
+		} else{
78 79
 			$elem->setContent($content);
79 80
 		}
80 81
 		$this->content[]=$elem;
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
 	public function _addEvent($event, $jsCode) {
108 109
 		foreach ($this->content as $li){
109 110
 			$content=$li->getContent();
110
-			if($content instanceof BaseHtml)
111
-				$content->_addEvent($event,$jsCode);
111
+			if($content instanceof BaseHtml) {
112
+							$content->_addEvent($event,$jsCode);
113
+			}
112 114
 		}
113 115
 	}
114 116
 	/**
@@ -146,8 +148,9 @@  discard block
 block discarded – undo
146 148
 		if (is_int($size)) {
147 149
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
148 150
 		}
149
-		if(!JString::startsWith($size, "pagination-") && $size!=="")
150
-			$size="pagination-".$size;
151
+		if(!JString::startsWith($size, "pagination-") && $size!=="") {
152
+					$size="pagination-".$size;
153
+		}
151 154
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
152 155
 	}
153 156
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPanel.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 	 * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default"
90 90
 	 */
91 91
 	public function setStyle($cssStyle) {
92
-		if (!JString::startsWith($cssStyle, "panel"))
93
-			$cssStyle="panel".$cssStyle;
92
+		if (!JString::startsWith($cssStyle, "panel")) {
93
+					$cssStyle="panel".$cssStyle;
94
+		}
94 95
 		return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
95 96
 	}
96 97
 
@@ -132,7 +133,8 @@  discard block
 block discarded – undo
132 133
 	 * @return $this default : false
133 134
 	 */
134 135
 	public function show($value) {
135
-		if ($this->_collapsable)
136
-			$this->_showOnStartup=$value;
136
+		if ($this->_collapsable) {
137
+					$this->_showOnStartup=$value;
138
+		}
137 139
 	}
138 140
 }
Please login to merge, or discard this patch.