Passed
Push — master ( 277c03...b6fa43 )
by Jean-Christophe
04:42
created
Ajax/semantic/html/elements/HtmlLabel.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,12 +99,12 @@
 block discarded – undo
99 99
 	}
100 100
 
101 101
 	/**
102
-	*  Adds an image
103
-	* @param string $src
104
-	* @param string $alt
105
-	* @param boolean $before
106
-	* @return HtmlImg
107
-	*/
102
+	 *  Adds an image
103
+	 * @param string $src
104
+	 * @param string $alt
105
+	 * @param boolean $before
106
+	 * @return HtmlImg
107
+	 */
108 108
 	public function addImage($src, $alt="", $before=true) {
109 109
 		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
110 110
 		$img->setClass("");
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * @version 1.001
19 19
  */
20 20
 class HtmlLabel extends HtmlSemDoubleElement {
21
-	use LabeledIconTrait,HasTimeoutTrait;
21
+	use LabeledIconTrait, HasTimeoutTrait;
22 22
 
23 23
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
24 24
 		parent::__construct($identifier, $tagName, "ui label");
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	 * @return HtmlLabel
34 34
 	 */
35 35
 	public function setPointing($value=Direction::NONE) {
36
-		if($value==="left" || $value==="right")
36
+		if ($value==="left" || $value==="right")
37 37
 			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
38 38
 		else
39
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
39
+			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing", true));
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 	 * @return HtmlLabel
46 46
 	 */
47 47
 	public function toCorner($side="left") {
48
-		return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" ));
48
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
49 49
 	}
50 50
 
51
-	public function setHorizontal(){
52
-		return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal"));
51
+	public function setHorizontal() {
52
+		return $this->addToPropertyCtrl("class", "hozizontal", array("horizontal"));
53 53
 	}
54 54
 
55
-	public function setFloating(){
56
-		return $this->addToPropertyCtrl("class", "floating",array("floating"));
55
+	public function setFloating() {
56
+		return $this->addToPropertyCtrl("class", "floating", array("floating"));
57 57
 	}
58 58
 
59 59
 	/**
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 		return $this->addToProperty("class", "tag");
65 65
 	}
66 66
 
67
-	public function setEmpty(){
67
+	public function setEmpty() {
68 68
 		$this->content=NULL;
69
-		return $this->addToPropertyCtrl("class", "empty",array("empty"));
69
+		return $this->addToPropertyCtrl("class", "empty", array("empty"));
70 70
 	}
71 71
 
72 72
 	public function setBasic() {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function addEmphasisImage($src, $alt="", $before=true) {
84 84
 		$this->addToProperty("class", "image");
85
-		return $this->addImage($src,$alt,$before);
85
+		return $this->addImage($src, $alt, $before);
86 86
 	}
87 87
 
88 88
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @return HtmlImg
94 94
 	 */
95 95
 	public function addAvatarImage($src, $alt="", $before=true) {
96
-		$img=$this->addImage($src,$alt,$before);
96
+		$img=$this->addImage($src, $alt, $before);
97 97
 		$img->setClass("ui image");
98 98
 		$img->asAvatar();
99 99
 		return $img;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	* @return HtmlImg
108 108
 	*/
109 109
 	public function addImage($src, $alt="", $before=true) {
110
-		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
110
+		$img=new HtmlImg("image-".$this->identifier, $src, $alt);
111 111
 		$img->setClass("");
112 112
 		$this->addContent($img, $before);
113 113
 		return $img;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * @return HtmlDoubleElement
120 120
 	 */
121 121
 	public function addDetail($detail) {
122
-		$div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail");
122
+		$div=new HtmlSemDoubleElement("detail-".$this->identifier, $this->tagName, "detail");
123 123
 		$div->setContent($detail);
124 124
 		$this->addContent($div);
125 125
 		return $div;
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 	 * @return HtmlLabel
131 131
 	 */
132 132
 	public function asRibbon($direction=Direction::NONE) {
133
-		return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" ));
133
+		return $this->addToPropertyCtrl("class", $direction." ribbon", array("ribbon", "right ribbon", "left ribbon"));
134 134
 	}
135 135
 
136
-	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"));
136
+	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 139
 		else
140
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
140
+			return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
141 141
 	}
142 142
 
143 143
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @param string $direction one of RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE="",BELOW="below"
147 147
 	 * @return HtmlLabel
148 148
 	 */
149
-	public static function ribbon($identifier, $caption,$direction=Direction::NONE) {
149
+	public static function ribbon($identifier, $caption, $direction=Direction::NONE) {
150 150
 		return (new HtmlLabel($identifier, $caption))->asRibbon($direction);
151 151
 	}
152 152
 
Please login to merge, or discard this 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/Bootstrap.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 	 * @param string $tagName container tagName
177 177
 	 * @return HtmlListgroup
178 178
 	 */
179
-	public function htmlListgroup($identifier,$items=array(),$tagName="ul"){
180
-		$listGroup=new HtmlListgroup($identifier,$tagName);
179
+	public function htmlListgroup($identifier, $items=array(), $tagName="ul") {
180
+		$listGroup=new HtmlListgroup($identifier, $tagName);
181 181
 		$listGroup->addItems($items);
182 182
 		return $this->addHtmlComponent($listGroup);
183 183
 	}
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 	 * @param string $onClick
203 203
 	 * @return HtmlSplitbutton
204 204
 	 */
205
-	public function htmlSplitbutton($identifier,$value="", $items=array(), $cssStyle="btn-default", $onClick=NULL) {
206
-		return $this->addHtmlComponent(new HtmlSplitbutton($identifier, $value, $items, $cssStyle,$onClick));
205
+	public function htmlSplitbutton($identifier, $value="", $items=array(), $cssStyle="btn-default", $onClick=NULL) {
206
+		return $this->addHtmlComponent(new HtmlSplitbutton($identifier, $value, $items, $cssStyle, $onClick));
207 207
 	}
208 208
 
209 209
 	/**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 * @param string $identifier
212 212
 	 * @return HtmlInputgroup
213 213
 	 */
214
-	public function htmlInputgroup($identifier){
214
+	public function htmlInputgroup($identifier) {
215 215
 		return $this->addHtmlComponent(new HtmlInputgroup($identifier));
216 216
 	}
217 217
 
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
224 224
 	 * @return HtmlBreadcrumbs
225 225
 	 */
226
-	public function htmlBreadcrumbs($identifier,$elements=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
227
-		return $this->addHtmlComponent(new HtmlBreadcrumbs($identifier,$elements,$autoActive,$startIndex,$hrefFunction));
226
+	public function htmlBreadcrumbs($identifier, $elements=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
227
+		return $this->addHtmlComponent(new HtmlBreadcrumbs($identifier, $elements, $autoActive, $startIndex, $hrefFunction));
228 228
 	}
229 229
 
230 230
 	/**
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
 	 * @param int $active The active page
237 237
 	 * @return HtmlPagination
238 238
 	 */
239
-	public function htmlPagination($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
240
-		return $this->addHtmlComponent(new HtmlPagination($identifier,$from,$to,$active,$countVisible));
239
+	public function htmlPagination($identifier, $from=1, $to=1, $active=NULL, $countVisible=NULL) {
240
+		return $this->addHtmlComponent(new HtmlPagination($identifier, $from, $to, $active, $countVisible));
241 241
 	}
242 242
 
243 243
 	/**
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 * @param int $numCols
249 249
 	 * @return HtmlGridSystem
250 250
 	 */
251
-	public function htmlGridSystem($identifier,$numRows=1,$numCols=NULL){
252
-		return $this->addHtmlComponent(new HtmlGridSystem($identifier,$numRows,$numCols));
251
+	public function htmlGridSystem($identifier, $numRows=1, $numCols=NULL) {
252
+		return $this->addHtmlComponent(new HtmlGridSystem($identifier, $numRows, $numCols));
253 253
 	}
254 254
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabelGroups.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class HtmlLabelGroups extends HtmlSemCollection {
17 17
 
18
-	public function __construct($identifier,$labels=array(), $attributes=array()) {
18
+	public function __construct($identifier, $labels=array(), $attributes=array()) {
19 19
 		parent::__construct($identifier, "div", "ui labels");
20
-		$this->_states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]);
20
+		$this->_states=\array_merge(Size::getConstants(), Color::getConstants(), ["tag", "circular"]);
21 21
 		$this->addItems($labels);
22 22
 		$this->setStates($attributes);
23 23
 	}
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 			$icon=JArray::getValue($value, "icon", 1);
32 32
 			$tagName=JArray::getValue($value, "tagName", 2);
33 33
 		}
34
-		$labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName);
34
+		$labelO=new HtmlLabel("label-".$this->identifier, $caption, $icon, $tagName);
35 35
 		return $labelO;
36 36
 	}
37 37
 
38 38
 	protected function createCondition($value) {
39
-		return ($value instanceof HtmlLabel) === false;
39
+		return ($value instanceof HtmlLabel)===false;
40 40
 	}
41 41
 
42 42
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@
 block discarded – undo
14 14
 class HtmlContainer extends HtmlSemDoubleElement {
15 15
 	use TextAlignmentTrait;
16 16
 	public function __construct($identifier, $content="") {
17
-		parent::__construct($identifier, "div","ui container");
17
+		parent::__construct($identifier, "div", "ui container");
18 18
 		$this->content=$content;
19 19
 	}
20 20
 
21
-	public function asText(){
21
+	public function asText() {
22 22
 		return $this->addToProperty("class", "text");
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlInput.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  discard block
 block discarded – undo
10 10
 use Ajax\JsUtils;
11 11
 
12 12
 class HtmlInput extends HtmlSemDoubleElement {
13
-	use IconTrait,TextFieldsTrait,FieldTrait;
13
+	use IconTrait, TextFieldsTrait, FieldTrait;
14 14
 
15 15
 	public function __construct($identifier, $type="text", $value="", $placeholder="") {
16
-		parent::__construct("div-" . $identifier, "div", "ui input");
16
+		parent::__construct("div-".$identifier, "div", "ui input");
17 17
 		$this->_identifier=$identifier;
18
-		$this->content=[ "field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder) ];
19
-		$this->_states=[ State::DISABLED,State::FOCUS,State::ERROR ];
20
-		$this->_variations=[ Variation::TRANSPARENT ];
18
+		$this->content=["field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder)];
19
+		$this->_states=[State::DISABLED, State::FOCUS, State::ERROR];
20
+		$this->_variations=[Variation::TRANSPARENT];
21 21
 	}
22 22
 
23 23
 	public function getField() {
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 
38 38
 	public function run(JsUtils $js) {
39 39
 		$result=parent::run($js);
40
-		$result->attach("#" . $this->getDataField()->getIdentifier());
40
+		$result->attach("#".$this->getDataField()->getIdentifier());
41 41
 		return $result;
42 42
 	}
43 43
 
44
-	public function setTransparent(){
44
+	public function setTransparent() {
45 45
 		return $this->addToProperty("class", "transparent");
46 46
 	}
47 47
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlDivider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @return HtmlDivider
24 24
 	 */
25 25
 	public function setVertical() {
26
-		return $this->addToPropertyCtrl("class", "vertical", array ("vertical","horizontal" ));
26
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical", "horizontal"));
27 27
 	}
28 28
 
29 29
 	/**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @return HtmlDivider
32 32
 	 */
33 33
 	public function setHorizontal() {
34
-		return $this->addToPropertyCtrl("class", "horizontal", array ("vertical","horizontal" ));
34
+		return $this->addToPropertyCtrl("class", "horizontal", array("vertical", "horizontal"));
35 35
 	}
36 36
 
37 37
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 * @return HtmlDivider
63 63
 	 */
64
-	public function setIgnored(){
64
+	public function setIgnored() {
65 65
 		return $this->addToProperty("class", "ignored");
66 66
 	}
67 67
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 			$this->setLabel($label);
20 20
 	}
21 21
 
22
-	public function setChecked($value=true){
23
-		if($value===true){
22
+	public function setChecked($value=true) {
23
+		if ($value===true) {
24 24
 			$this->getField()->setProperty("checked", "checked");
25
-		}else{
25
+		} else {
26 26
 			$this->getField()->removeProperty("checked");
27 27
 		}
28 28
 		return $this;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox
85 85
 	 */
86 86
 	public function attachEvent($selector, $action=NULL) {
87
-		if (isset($action)||\is_numeric($action)===true) {
87
+		if (isset($action) || \is_numeric($action)===true) {
88 88
 			$js='$("#%identifier%").checkbox("attach events", "'.$selector.'", "'.$action.'");';
89 89
 		} else {
90 90
 			$js='$("#%identifier%").checkbox("attach events", "'.$selector.'");';
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function attachEvents($events=array()) {
102 102
 		if (\is_array($events)) {
103
-			foreach ( $events as $action => $selector ) {
103
+			foreach ($events as $action => $selector) {
104 104
 				$this->attachEvent($selector, $action);
105 105
 			}
106 106
 		}
@@ -111,24 +111,24 @@  discard block
 block discarded – undo
111 111
 		return $this->addToProperty("class", "fitted");
112 112
 	}
113 113
 
114
-	public function setOnChecked($jsCode){
114
+	public function setOnChecked($jsCode) {
115 115
 		$this->_params["onChecked"]=$jsCode;
116 116
 		return $this;
117 117
 	}
118 118
 
119
-	public function setOnUnchecked($jsCode){
119
+	public function setOnUnchecked($jsCode) {
120 120
 		$this->_params["onUnchecked"]=$jsCode;
121 121
 		return $this;
122 122
 	}
123 123
 
124
-	public function setOnChange($jsCode){
124
+	public function setOnChange($jsCode) {
125 125
 		$this->_params["onChange"]=$jsCode;
126 126
 		return $this;
127 127
 	}
128 128
 
129 129
 	public function run(JsUtils $js) {
130
-		if(!isset($this->_bsComponent))
131
-			$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
130
+		if (!isset($this->_bsComponent))
131
+			$this->_bsComponent=$js->semantic()->checkbox("#".$this->identifier, $this->_params);
132 132
 		return parent::run($js);
133 133
 	}
134 134
 }
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 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);
18
+		if (isset($label)) {
19
+					$this->setLabel($label);
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;
@@ -51,8 +52,9 @@  discard block
 block discarded – undo
51 52
 	 * @return mixed
52 53
 	 */
53 54
 	public function getLabel() {
54
-		if (\array_key_exists("label", $this->content))
55
-			return $this->content["label"];
55
+		if (\array_key_exists("label", $this->content)) {
56
+					return $this->content["label"];
57
+		}
56 58
 	}
57 59
 
58 60
 	/**
@@ -127,8 +129,9 @@  discard block
 block discarded – undo
127 129
 	}
128 130
 
129 131
 	public function run(JsUtils $js) {
130
-		if(!isset($this->_bsComponent))
131
-			$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
132
+		if(!isset($this->_bsComponent)) {
133
+					$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
134
+		}
132 135
 		return parent::run($js);
133 136
 	}
134 137
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlTab.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@  discard block
 block discarded – undo
67 67
 		if($index<$menu->count()){
68 68
 			if(isset($this->content[$index])===false){
69 69
 				$this->content[$index]=$this->createSegment($index, $content, $menu->getItem($index)->getIdentifier());
70
-			}else
71
-				$this->content[$index]->setContent($content);
70
+			} else {
71
+							$this->content[$index]->setContent($content);
72
+			}
72 73
 		}
73 74
 		return $this;
74 75
 	}
@@ -231,15 +232,17 @@  discard block
 block discarded – undo
231 232
 	 * @see BaseHtml::run()
232 233
 	 */
233 234
 	public function run(JsUtils $js) {
234
-		if(isset($this->_bsComponent)===false)
235
-			$this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params);
235
+		if(isset($this->_bsComponent)===false) {
236
+					$this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params);
237
+		}
236 238
 			$this->addEventsOnRun($js);
237 239
 			return $this->_bsComponent;
238 240
 	}
239 241
 
240 242
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
241
-		if($this->content["menu"]->count()>0 && \sizeof($this->content)>1)
242
-			$this->activate(0);
243
+		if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) {
244
+					$this->activate(0);
245
+		}
243 246
 		return parent::compile($js,$view);
244 247
 	}
245 248
 }
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
  * @author jc
15 15
  * @version 1.001
16 16
  */
17
-class HtmlTab extends HtmlSemCollection{
17
+class HtmlTab extends HtmlSemCollection {
18 18
 
19 19
 	protected $params=[];
20 20
 
21
-	public function __construct( $identifier, $tabs=array()){
22
-		parent::__construct( $identifier, "div", "");
21
+	public function __construct($identifier, $tabs=array()) {
22
+		parent::__construct($identifier, "div", "");
23 23
 		$menu=new HtmlMenu("menu".$this->identifier);
24
-		$menu->asTab(false)->setAttachment(NULL,Side::TOP);
24
+		$menu->asTab(false)->setAttachment(NULL, Side::TOP);
25 25
 		$this->content["menu"]=$menu;
26 26
 		$this->addItems($tabs);
27 27
 	}
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
32 32
 	 * @return HtmlSegment
33 33
 	 */
34
-	protected function createItem($value){
34
+	protected function createItem($value) {
35 35
 		$count=$this->count();
36 36
 		$title=$value;
37 37
 		$content=NULL;
38
-		if(\is_array($value)){
39
-			$title=@$value[0];$content=@$value[1];
38
+		if (\is_array($value)) {
39
+			$title=@$value[0]; $content=@$value[1];
40 40
 		}
41 41
 		$menuItem=$this->content["menu"]->addItem($title);
42 42
 		$menuItem->addToProperty("data-tab", $menuItem->getIdentifier());
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 	 * @param string $datatab
53 53
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
54 54
 	 */
55
-	private function createSegment($count,$content,$datatab){
55
+	private function createSegment($count, $content, $datatab) {
56 56
 		$segment=new HtmlSegment("item-".$this->identifier."-".$count, $content);
57
-		$segment->setAttachment(NULL,Side::BOTTOM)->addToProperty("class", "tab")->addToProperty("data-tab",$datatab);
57
+		$segment->setAttachment(NULL, Side::BOTTOM)->addToProperty("class", "tab")->addToProperty("data-tab", $datatab);
58 58
 		return $segment;
59 59
 	}
60 60
 
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 	 * @param String $content new content
65 65
 	 * @return \Ajax\semantic\html\modules\HtmlTab
66 66
 	 */
67
-	public function setTabContent($index,$content){
67
+	public function setTabContent($index, $content) {
68 68
 		$menu=$this->content["menu"];
69
-		if($index<$menu->count()){
70
-			if(isset($this->content[$index])===false){
69
+		if ($index<$menu->count()) {
70
+			if (isset($this->content[$index])===false) {
71 71
 				$this->content[$index]=$this->createSegment($index, $content, $menu->getItem($index)->getIdentifier());
72
-			}else
72
+			} else
73 73
 				$this->content[$index]->setContent($content);
74 74
 		}
75 75
 		return $this;
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 * @param array $contents
81 81
 	 * @return \Ajax\semantic\html\modules\HtmlTab
82 82
 	 */
83
-	public function setTabsContent($contents){
83
+	public function setTabsContent($contents) {
84 84
 		$size=\sizeof($contents);
85
-		for($i=0;$i<$size;$i++){
85
+		for ($i=0; $i<$size; $i++) {
86 86
 			$this->setTabContent($i, $contents[$i]);
87 87
 		}
88 88
 		return $this;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @param int $index
94 94
 	 * @return \Ajax\semantic\html\modules\HtmlTab
95 95
 	 */
96
-	public function activate($index){
96
+	public function activate($index) {
97 97
 		$this->content["menu"]->getItem($index)->setActive(true);
98 98
 		$this->content[$index]->setActive(true);
99 99
 		return $this;
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 * @param string $content
106 106
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
107 107
 	 */
108
-	public function addTab($title,$content){
109
-		return $this->addItem([$title,$content]);
108
+	public function addTab($title, $content) {
109
+		return $this->addItem([$title, $content]);
110 110
 	}
111 111
 
112 112
 	/**
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
 	 * @param array $params
121 121
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
122 122
 	 */
123
-	public function forwardTab($index,JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
124
-		if(\array_key_exists($index, $this->content)){
125
-			$this->content[$index]=$js->forward($initialController, $controller, $action,$params);
123
+	public function forwardTab($index, JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
124
+		if (\array_key_exists($index, $this->content)) {
125
+			$this->content[$index]=$js->forward($initialController, $controller, $action, $params);
126 126
 			return $this->content[$index];
127 127
 		}
128 128
 
129
-		return $this->addAndForwardTab($js, $title, $initialController, $controller, $action,$params);
129
+		return $this->addAndForwardTab($js, $title, $initialController, $controller, $action, $params);
130 130
 	}
131 131
 
132 132
 	/**
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 	 * @param $params The parameters to pass to the view
140 140
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
141 141
 	 */
142
-	public function renderViewTab($index,JsUtils $js,$title,$initialController, $viewName, $params=array()) {
143
-		if(\array_key_exists($index, $this->content)){
144
-			$this->content[$index]=$js->renderContent($initialController, $viewName,$params);
142
+	public function renderViewTab($index, JsUtils $js, $title, $initialController, $viewName, $params=array()) {
143
+		if (\array_key_exists($index, $this->content)) {
144
+			$this->content[$index]=$js->renderContent($initialController, $viewName, $params);
145 145
 			return $this->content[$index];
146 146
 		}
147
-		return $this->addAndRenderViewTab($js, $title, $initialController, $viewName,$params);
147
+		return $this->addAndRenderViewTab($js, $title, $initialController, $viewName, $params);
148 148
 	}
149 149
 
150 150
 
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
 	 * @param array $params
159 159
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
160 160
 	 */
161
-	public function addAndForwardTab(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
161
+	public function addAndForwardTab(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
162 162
 		\ob_start();
163
-		$js->forward($initialController, $controller, $action,$params);
163
+		$js->forward($initialController, $controller, $action, $params);
164 164
 		$content=\ob_get_clean();
165
-		return $this->addTab($title,$content);
165
+		return $this->addTab($title, $content);
166 166
 	}
167 167
 
168 168
 	/**
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 	 * @param $params The parameters to pass to the view
175 175
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
176 176
 	 */
177
-	public function addAndRenderViewTab(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
178
-		return $this->addTab($title, $js->renderContent($initialController, $viewName,$params));
177
+	public function addAndRenderViewTab(JsUtils $js, $title, $initialController, $viewName, $params=array()) {
178
+		return $this->addTab($title, $js->renderContent($initialController, $viewName, $params));
179 179
 	}
180 180
 
181 181
 	public function setPointing($value=Direction::NONE) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 * @param int $index
192 192
 	 * @return Ajax\semantic\html\content\HtmlMenuItem
193 193
 	 */
194
-	public function getMenuTab($index){
194
+	public function getMenuTab($index) {
195 195
 		return $this->content["menu"]->getItem($index);
196 196
 	}
197 197
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 * @param int $index
201 201
 	 * @return HtmlSegment
202 202
 	 */
203
-	public function getTab($index){
203
+	public function getTab($index) {
204 204
 		return $this->content[$index];
205 205
 	}
206 206
 
@@ -209,22 +209,22 @@  discard block
 block discarded – undo
209 209
 	 * @param HtmlMenu $menu
210 210
 	 * @return \Ajax\semantic\html\modules\HtmlTab
211 211
 	 */
212
-	public function setMenu($menu){
212
+	public function setMenu($menu) {
213 213
 		$contentSize=\sizeof($this->content);
214
-		for($i=0;$i<$contentSize;$i++){
215
-			if($menu->getItem($i)!==NULL){
216
-				if(isset($this->content[$i])){
217
-					$menu->getItem($i)->addToProperty("data-tab",$this->content[$i]->getProperty("data-tab"));
214
+		for ($i=0; $i<$contentSize; $i++) {
215
+			if ($menu->getItem($i)!==NULL) {
216
+				if (isset($this->content[$i])) {
217
+					$menu->getItem($i)->addToProperty("data-tab", $this->content[$i]->getProperty("data-tab"));
218 218
 				}
219 219
 			}
220 220
 		}
221 221
 		$menuSize=$menu->count();
222
-		for($i=0;$i<$menuSize;$i++){
222
+		for ($i=0; $i<$menuSize; $i++) {
223 223
 			$menu->getItem($i)->removeProperty("href");
224
-			if(isset($this->content[$i])===false){
224
+			if (isset($this->content[$i])===false) {
225 225
 				$this->content[$i]=$this->createSegment($i, "New content", $menu->getItem($i)->getIdentifier());
226 226
 			}
227
-			$menu->getItem($i)->addToProperty("data-tab",$this->content[$i]->getProperty("data-tab"));
227
+			$menu->getItem($i)->addToProperty("data-tab", $this->content[$i]->getProperty("data-tab"));
228 228
 		}
229 229
 
230 230
 		$this->content["menu"]=$menu;
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
 	 * @see BaseHtml::run()
237 237
 	 */
238 238
 	public function run(JsUtils $js) {
239
-		if(isset($this->_bsComponent)===false)
240
-			$this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params);
239
+		if (isset($this->_bsComponent)===false)
240
+			$this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item", $this->params);
241 241
 			$this->addEventsOnRun($js);
242 242
 			return $this->_bsComponent;
243 243
 	}
244 244
 
245 245
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
246
-		if($this->content["menu"]->count()>0 && \sizeof($this->content)>1)
246
+		if ($this->content["menu"]->count()>0 && \sizeof($this->content)>1)
247 247
 			$this->activate(0);
248
-		return parent::compile($js,$view);
248
+		return parent::compile($js, $view);
249 249
 	}
250 250
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlRating.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	 * @param int $max
14 14
 	 * @param string $icon star or heart
15 15
 	 */
16
-	public function __construct($identifier, $value,$max=5,$icon="") {
16
+	public function __construct($identifier, $value, $max=5, $icon="") {
17 17
 		parent::__construct($identifier, "div", "ui {$icon} rating");
18 18
 		$this->setValue($value);
19 19
 		$this->setMax($max);
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\common\html\HtmlDoubleElement::setValue()
25 25
 	 */
26
-	public function setValue($value){
26
+	public function setValue($value) {
27 27
 		$this->setProperty("data-rating", $value);
28 28
 	}
29 29
 
30
-	public function setMax($max){
30
+	public function setMax($max) {
31 31
 		$this->setProperty("data-max-rating", $max);
32 32
 	}
33 33
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 	 * {@inheritDoc}
36 36
 	 * @see HtmlSemDoubleElement::run()
37 37
 	 */
38
-	public function run(JsUtils $js){
38
+	public function run(JsUtils $js) {
39 39
 		parent::run($js);
40
-		return $js->semantic()->rating("#".$this->identifier,$this->_params);
40
+		return $js->semantic()->rating("#".$this->identifier, $this->_params);
41 41
 	}
42 42
 
43
-	public function asStar(){
43
+	public function asStar() {
44 44
 		return $this->setIcon();
45 45
 	}
46 46
 
47
-	public function asHeart(){
47
+	public function asHeart() {
48 48
 		return $this->setIcon("heart");
49 49
 	}
50 50
 
51
-	public function setIcon($icon="star"){
52
-		return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]);
51
+	public function setIcon($icon="star") {
52
+		return $this->addToPropertyCtrl("class", $icon, ["star", "heart", ""]);
53 53
 	}
54 54
 
55 55
 }
Please login to merge, or discard this patch.