Passed
Push — master ( 468e47...0bebef )
by Jean-Christophe
02:09
created
Ajax/service/AjaxCall.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
 		$this->parameters["immediatly"]=false;
24 24
 		extract($this->parameters);
25 25
 		$result=$this->_eventPreparing($preventDefault, $stopPropagation);
26
-		switch($this->method) {
26
+		switch ($this->method) {
27 27
 			case "get":
28 28
 				$result.=$js->getDeferred($url, $responseElement, $this->parameters);
29 29
 				break;
30 30
 			case "post":
31
-				$result.=$js->postDeferred($url, $params,$responseElement, $this->parameters);
31
+				$result.=$js->postDeferred($url, $params, $responseElement, $this->parameters);
32 32
 				break;
33 33
 			case "postForm":
34 34
 				$result.=$js->postFormDeferred($url, $form, $responseElement, $this->parameters);
35 35
 				break;
36 36
 			case "json":
37
-				$result.=$js->jsonDeferred($url,$method,$this->parameters);
37
+				$result.=$js->jsonDeferred($url, $method, $this->parameters);
38 38
 				break;
39 39
 			case "jsonArray":
40
-				$result.=$js->jsonArrayDeferred($modelSelector, $url,$method,$this->parameters);
40
+				$result.=$js->jsonArrayDeferred($modelSelector, $url, $method, $this->parameters);
41 41
 				break;
42 42
 			default:
43 43
 				break;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		return $result;
46 46
 	}
47 47
 
48
-	protected function _eventPreparing($preventDefault,$stopPropagation){
48
+	protected function _eventPreparing($preventDefault, $stopPropagation) {
49 49
 		$result="";
50 50
 		if ($preventDefault===true) {
51 51
 			$result.=Javascript::$preventDefault;
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlUtils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 namespace Ajax\common\html\html5;
4 4
 
5 5
 class HtmlUtils {
6
-	public static function javascriptInclude($url){
6
+	public static function javascriptInclude($url) {
7 7
 		return '<script src="'.$url.'"></script>';
8 8
 	}
9 9
 	
10
-	public static function stylesheetInclude($url){
10
+	public static function stylesheetInclude($url) {
11 11
 		return '<link rel="stylesheet" type="text/css" href="'.$url.'">';
12 12
 	}
13 13
 }
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@  discard block
 block discarded – undo
8 8
  * @author jc
9 9
  * @property BaseWidget $_self
10 10
  */
11
-trait BaseHtmlPropertiesTrait{
11
+trait BaseHtmlPropertiesTrait {
12 12
 
13
-	protected $properties=array ();
13
+	protected $properties=array();
14 14
 	abstract protected function ctrl($name, $value, $typeCtrl);
15 15
 	abstract protected function removeOldValues(&$oldValue, $allValues);
16
-	abstract protected function _getElementBy($callback,$elements);
16
+	abstract protected function _getElementBy($callback, $elements);
17 17
 	public function getProperties() {
18 18
 		return $this->_self->properties;
19 19
 	}
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function addToProperty($name, $value, $separator=" ") {
47 47
 		if (\is_array($value)) {
48
-			foreach ( $value as $v ) {
48
+			foreach ($value as $v) {
49 49
 				$this->_self->addToProperty($name, $v, $separator);
50 50
 			}
51
-		} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
52
-			if(isset($this->_self->properties[$name])){
51
+		} else if ($value!=="" && $this->_self->propertyContains($name, $value)===false) {
52
+			if (isset($this->_self->properties[$name])) {
53 53
 				$v=$this->_self->properties[$name];
54
-				if (isset($v) && $v !== "")
55
-					$v=$v . $separator . $value;
54
+				if (isset($v) && $v!=="")
55
+					$v=$v.$separator.$value;
56 56
 					else
57 57
 						$v=$value;
58 58
 	
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 
93 93
 	public function addToPropertyCtrlCheck($name, $value, $typeCtrl) {
94
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
94
+		if ($this->_self->ctrl($name, $value, $typeCtrl)===true) {
95 95
 			return $this->_self->addToProperty($name, $value);
96 96
 		}
97 97
 		return $this;
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 	}
113 113
 
114 114
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
115
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
115
+		if ($this->_self->ctrl($name, $value, $typeCtrl)===true)
116 116
 			return $this->_self->setProperty($name, $value);
117 117
 			return $this;
118 118
 	}
119 119
 
120
-	protected function getElementByPropertyValue($propertyName,$value, $elements) {
121
-		return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements);
120
+	protected function getElementByPropertyValue($propertyName, $value, $elements) {
121
+		return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName, $value){return $element->propertyContains($propertyName, $value)===true; }, $elements);
122 122
 	}
123 123
 }
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlNavbar.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	public function __construct($identifier, $brand="Brand", $brandHref="#") {
33 33
 		parent::__construct($identifier);
34 34
 		$this->_template=include 'templates/tplNavbar.php';
35
-		$this->navZones=array ();
35
+		$this->navZones=array();
36 36
 		$this->class="navbar-default";
37 37
 		$this->brand=$brand;
38 38
 		$this->brandHref=$brandHref;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	public function setBrandImage($imageSrc) {
63
-		$this->brandImage=new HtmlImg("brand-img-".$this->_identifier,$imageSrc,$this->brand);
63
+		$this->brandImage=new HtmlImg("brand-img-".$this->_identifier, $imageSrc, $this->brand);
64 64
 		$this->brand="";
65 65
 		return $this;
66 66
 	}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function setNavZones($navZones) {
106 106
 		if (\is_array($navZones)) {
107
-			foreach ( $navZones as $zoneType => $zoneArray ) {
107
+			foreach ($navZones as $zoneType => $zoneArray) {
108 108
 				if (is_string($zoneType)) {
109 109
 					$zone=$this->addZone($zoneType);
110 110
 					$zone->fromArray($zoneArray);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			if ($index<$nb)
145 145
 				$zone=$this->navZones [$index];
146 146
 		} else {
147
-			for($i=0; $i<$nb; $i++) {
147
+			for ($i=0; $i<$nb; $i++) {
148 148
 				if ($this->navZones [$i]->getIdentifier()===$index) {
149 149
 					$zone=$this->navZones [$i];
150 150
 					break;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 
157 157
 	public function run(JsUtils $js) {
158
-		foreach ( $this->navZones as $zone ) {
158
+		foreach ($this->navZones as $zone) {
159 159
 			$zone->run($js);
160 160
 		}
161 161
 		if ($this->hasScrollspy) {
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	}
178 178
 
179 179
 	public function setFluid($fluid) {
180
-		if($fluid===true){
180
+		if ($fluid===true) {
181 181
 			$this->fluid="container-fluid";
182
-		}else{
182
+		} else {
183 183
 			$this->fluid="container";
184 184
 		}
185 185
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTR.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -20,19 +20,19 @@  discard block
 block discarded – undo
20 20
 
21 21
 	public function __construct($identifier) {
22 22
 		parent::__construct($identifier, "tr", "");
23
-		$this->_states=[ State::ACTIVE,State::POSITIVE,State::NEGATIVE,State::WARNING,State::ERROR,State::DISABLED ];
23
+		$this->_states=[State::ACTIVE, State::POSITIVE, State::NEGATIVE, State::WARNING, State::ERROR, State::DISABLED];
24 24
 	}
25 25
 
26 26
 	public function setColCount($colCount) {
27 27
 		$count=$this->count();
28
-		for($i=$count; $i < $colCount; $i++) {
28
+		for ($i=$count; $i<$colCount; $i++) {
29 29
 			$item=$this->addItem(NULL);
30 30
 			$item->setTagName($this->_tdTagName);
31 31
 		}
32 32
 		return $this;
33 33
 	}
34 34
 
35
-	public function getColCount(){
35
+	public function getColCount() {
36 36
 		return $this->count();
37 37
 	}
38 38
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	/**
53 53
 	 * @return HtmlTD
54 54
 	 */
55
-	public function getItem($index){
55
+	public function getItem($index) {
56 56
 		return parent::getItem($index);
57 57
 	}
58 58
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @param mixed $values
76 76
 	 */
77 77
 	public function setValues($values=array()) {
78
-		return $this->_addOrSetValues($values, function(HtmlTD &$cell,$value){$cell->setValue($value);});
78
+		return $this->_addOrSetValues($values, function(HtmlTD &$cell, $value) {$cell->setValue($value); });
79 79
 	}
80 80
 
81 81
 	/**
@@ -83,27 +83,27 @@  discard block
 block discarded – undo
83 83
 	 * @param mixed $values
84 84
 	 */
85 85
 	public function addValues($values=array()) {
86
-		return $this->_addOrSetValues($values, function(HtmlTD &$cell,$value){$cell->addValue($value);});
86
+		return $this->_addOrSetValues($values, function(HtmlTD &$cell, $value) {$cell->addValue($value); });
87 87
 	}
88 88
 
89 89
 	/**
90 90
 	 * Sets or adds values to the row cols
91 91
 	 * @param mixed $values
92 92
 	 */
93
-	protected function _addOrSetValues($values,$callback) {
93
+	protected function _addOrSetValues($values, $callback) {
94 94
 		$count=$this->count();
95 95
 		if (!\is_array($values)) {
96 96
 			$values=\array_fill(0, $count, $values);
97 97
 		} else {
98
-			if (JArray::isAssociative($values) === true) {
98
+			if (JArray::isAssociative($values)===true) {
99 99
 				$values=\array_values($values);
100 100
 			}
101 101
 		}
102 102
 		$count=\min(\sizeof($values), $count);
103 103
 
104
-		for($i=0; $i < $count; $i++) {
104
+		for ($i=0; $i<$count; $i++) {
105 105
 			$cell=$this->content[$i];
106
-			$callback($cell,$values[$i]);
106
+			$callback($cell, $values[$i]);
107 107
 		}
108 108
 		return $this;
109 109
 	}
@@ -127,24 +127,24 @@  discard block
 block discarded – undo
127 127
 	}
128 128
 
129 129
 	public function getColPosition($colIndex) {
130
-		if($this->_container->_isMerged()!==true)
130
+		if ($this->_container->_isMerged()!==true)
131 131
 			return $colIndex;
132 132
 		$pos=0;
133 133
 		$rows=$this->_container->getContent();
134
-		for($i=0; $i < $this->_row; $i++) {
134
+		for ($i=0; $i<$this->_row; $i++) {
135 135
 			$max=\min($colIndex, $rows[$i]->count());
136
-			for($j=0; $j < $max; $j++) {
136
+			for ($j=0; $j<$max; $j++) {
137 137
 				$rowspan=$rows[$i]->getItem($j)->getRowspan();
138
-				if ($rowspan + $i > $this->_row)
138
+				if ($rowspan+$i>$this->_row)
139 139
 					$pos++;
140 140
 			}
141 141
 		}
142
-		if ($pos > $colIndex)
142
+		if ($pos>$colIndex)
143 143
 			return NULL;
144 144
 		$count=$this->count();
145
-		for($i=0; $i < $count; $i++) {
145
+		for ($i=0; $i<$count; $i++) {
146 146
 			$pos+=$this->content[$i]->getColspan();
147
-			if ($pos >= $colIndex + 1)
147
+			if ($pos>=$colIndex+1)
148 148
 				return $i;
149 149
 		}
150 150
 		return null;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
 	public function conditionalCellFormat($callback, $format) {
154 154
 		$cells=$this->content;
155
-		foreach ( $cells as $cell ) {
155
+		foreach ($cells as $cell) {
156 156
 			$cell->conditionalCellFormat($callback, $format);
157 157
 		}
158 158
 		return $this;
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 
168 168
 	public function containsStr($needle) {
169 169
 		$cells=$this->content;
170
-		foreach ( $cells as $cell ) {
171
-			if (\strpos($cell->getContent(), $needle) !== false)
170
+		foreach ($cells as $cell) {
171
+			if (\strpos($cell->getContent(), $needle)!==false)
172 172
 				return true;
173 173
 		}
174 174
 		return false;
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
 
182 182
 	public function applyCells($callback) {
183 183
 		$cells=$this->content;
184
-		foreach ( $cells as $cell ) {
184
+		foreach ($cells as $cell) {
185 185
 			$cell->apply($callback);
186 186
 		}
187 187
 		return $this;
188 188
 	}
189 189
 
190
-	public function toDelete($colIndex){
190
+	public function toDelete($colIndex) {
191 191
 		$this->getItem($colIndex)->toDelete();
192 192
 		return $this;
193 193
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlBreadcrumb.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$this->startIndex=$startIndex;
53 53
 		$this->autoActive=$autoActive;
54 54
 		$this->_contentSeparator="<div class='divider'> / </div>";
55
-		$this->_hrefFunction=function (HtmlSemDoubleElement $e) {
55
+		$this->_hrefFunction=function(HtmlSemDoubleElement $e) {
56 56
 			return $e->getContent();
57 57
 		};
58 58
 		if (isset($hrefFunction)) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return HtmlBreadcrumb
69 69
 	 */
70 70
 	public function autoGetOnClick($targetSelector) {
71
-		return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr ));
71
+		return $this->getOnClick($this->root, $targetSelector, array("attr" => $this->attr));
72 72
 	}
73 73
 
74 74
 	public function contentAsString() {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function setActive($index=null) {
85 85
 		if (!isset($index)) {
86
-			$index=sizeof($this->content) - 1;
86
+			$index=sizeof($this->content)-1;
87 87
 		}
88 88
 		$activeItem=$this->content[$index];
89 89
 		$activeItem->addToProperty("class", "active");
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @param object $dispatcher the request dispatcher
97 97
 	 * @return HtmlBreadcrumb
98 98
 	 */
99
-	public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) {
99
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
100 100
 		$this->startIndex=$startIndex;
101 101
 		return $this->addItems($js->fromDispatcher($dispatcher));
102 102
 	}
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		if (!isset($index)) {
112 112
 			$index=sizeof($this->content);
113 113
 		}
114
-		if ($this->absolutePaths === true) {
114
+		if ($this->absolutePaths===true) {
115 115
 			return $this->_hrefFunction($this->content[$index]);
116 116
 		} else {
117
-			return $this->root . implode($separator, array_slice(array_map(function ($e) {
117
+			return $this->root.implode($separator, array_slice(array_map(function($e) {
118 118
 				return $this->_hrefFunction($e);
119
-			}, $this->content), $this->startIndex, $index + 1));
119
+			}, $this->content), $this->startIndex, $index+1));
120 120
 		}
121 121
 	}
122 122
 
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 			$this->setActive();
151 151
 		}
152 152
 		$count=$this->count();
153
-		for($i=1; $i < $count; $i++) {
154
-			$this->content[$i]->wrap($this->getContentDivider($i - 1));
153
+		for ($i=1; $i<$count; $i++) {
154
+			$this->content[$i]->wrap($this->getContentDivider($i-1));
155 155
 		}
156 156
 		return parent::compile($js, $view);
157 157
 	}
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
162 162
 	 */
163 163
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
164
-		foreach ( $this->content as $element ) {
164
+		foreach ($this->content as $element) {
165 165
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
166 166
 		}
167 167
 		return $this;
168 168
 	}
169 169
 
170 170
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
171
-		foreach ( $this->content as $element ) {
172
-			if ($element->getProperty($this->attr) != NULL){
171
+		foreach ($this->content as $element) {
172
+			if ($element->getProperty($this->attr)!=NULL) {
173 173
 				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
174 174
 			}
175 175
 		}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	protected function createItem($value) {
186 186
 		$count=$this->count();
187
-		$itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section");
187
+		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section");
188 188
 		if (\is_array($value))
189 189
 			$itemO->fromArray($value);
190 190
 		else {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	public function addIconAt($icon, $index) {
197 197
 		$item=$this->getItem($index);
198 198
 		if (isset($item)) {
199
-			$icon=new HtmlIcon("icon-" . $this->identifier, $icon);
199
+			$icon=new HtmlIcon("icon-".$this->identifier, $icon);
200 200
 			$item->wrapContent($icon);
201 201
 		}
202 202
 	}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	public function addItem($item) {
205 205
 		$count=$this->count();
206 206
 		$itemO=parent::addItem($item);
207
-		$this->addToPropertyCtrl("class", "section", array ("section" ));
207
+		$this->addToPropertyCtrl("class", "section", array("section"));
208 208
 		$itemO->setProperty($this->attr, $this->getHref($count));
209 209
 		return $itemO;
210 210
 	}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	public function setAbsolutePaths($absolutePaths) {
221 221
 		$this->absolutePaths=$absolutePaths;
222 222
 		$size=\sizeof($this->content);
223
-		for($i=0;$i<$size;$i++){
223
+		for ($i=0; $i<$size; $i++) {
224 224
 			$this->content[$i]->setProperty($this->attr, $this->getHref($i));
225 225
 		}
226 226
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/HtmlViewItem.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 abstract class HtmlViewItem extends HtmlSemDoubleElement {
17 17
 	use ContentPartTrait;
18 18
 
19
-	public function __construct($identifier,$baseClass,$content=NULL) {
19
+	public function __construct($identifier, $baseClass, $content=NULL) {
20 20
 		parent::__construct($identifier, "div", $baseClass);
21 21
 		$this->content=["content"=>new HtmlViewContent("content-".$this->identifier)];
22
-		if(isset($content))
22
+		if (isset($content))
23 23
 			$this->setContent($content);
24 24
 	}
25 25
 
26
-	public function setContent($value){
26
+	public function setContent($value) {
27 27
 		if (\is_array($value)) {
28 28
 			$image=JArray::getValue($value, "image", 0);
29 29
 			$content=JArray::getValue($value, "content", 1);
@@ -31,57 +31,57 @@  discard block
 block discarded – undo
31 31
 			if (isset($image)) {
32 32
 				$this->addImage($image);
33 33
 			}
34
-			if(isset($content))
34
+			if (isset($content))
35 35
 				$this->content["content"]->setContent($content);
36
-			if(isset($extra))
36
+			if (isset($extra))
37 37
 				$this->addExtraContent($extra);
38 38
 		}
39 39
 	}
40 40
 
41 41
 	private function createContent($content, $baseClass="content") {
42 42
 		$count=\sizeof($this->content);
43
-		$result=new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content);
43
+		$result=new HtmlViewContent("content-".$count."-".$this->identifier, $content);
44 44
 		$result->setClass($baseClass);
45 45
 		return $result;
46 46
 	}
47 47
 
48 48
 	private function addElementIn($key, $element) {
49
-		if (\array_key_exists($key, $this->content) === false) {
49
+		if (\array_key_exists($key, $this->content)===false) {
50 50
 			$this->content[$key]=[];
51 51
 		}
52
-		if($this->content[$key] instanceof HtmlViewContent)
52
+		if ($this->content[$key] instanceof HtmlViewContent)
53 53
 			$this->content[$key]->addElement($element);
54 54
 		else
55 55
 			$this->content[$key][]=$element;
56 56
 		return $element;
57 57
 	}
58 58
 
59
-	public function addIcon($icon,$before=true){
60
-		return $this->addElementIn("icon",new HtmlIcon("icon-" . $this->identifier, $icon));
59
+	public function addIcon($icon, $before=true) {
60
+		return $this->addElementIn("icon", new HtmlIcon("icon-".$this->identifier, $icon));
61 61
 	}
62 62
 
63 63
 
64 64
 	public function addHeader($header, $niveau=4, $type="page") {
65 65
 		if (!$header instanceof HtmlHeader) {
66
-			$header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type);
66
+			$header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type);
67 67
 		}
68
-		return $this->addElementIn("header",$this->createContent($header));
68
+		return $this->addElementIn("header", $this->createContent($header));
69 69
 	}
70 70
 
71 71
 	public function addImage($image, $title="") {
72 72
 		if (!$image instanceof HtmlImage) {
73
-			$image=new HtmlImage("image-" . $this->identifier, $image, $title);
73
+			$image=new HtmlImage("image-".$this->identifier, $image, $title);
74 74
 		}
75 75
 		$image->setClass("ui image");
76
-		return $this->content["image"]= $image;
76
+		return $this->content["image"]=$image;
77 77
 	}
78 78
 
79
-	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL,$key="extra-content") {
79
+	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL, $key="extra-content") {
80 80
 		$reveal=$visibleContent;
81 81
 		if (!$visibleContent instanceof HtmlReveal) {
82
-			$reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
82
+			$reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
83 83
 		}
84
-		return $this->content[$key]= $reveal;
84
+		return $this->content[$key]=$reveal;
85 85
 	}
86 86
 
87 87
 	public function addRevealImage($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) {
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 		if (!$visibleContent instanceof HtmlReveal) {
90 90
 			return $this->addReveal(new HtmlImage("", $visibleContent), new HtmlImage("", $hiddenContent), $type, $attributeType);
91 91
 		}
92
-		return $this->content["image"]= $reveal;
92
+		return $this->content["image"]=$reveal;
93 93
 	}
94 94
 
95 95
 	public function addExtraContent($content=array()) {
96
-		return $this->content["extra-content"]= $this->createContent($content, "extra content");
96
+		return $this->content["extra-content"]=$this->createContent($content, "extra content");
97 97
 	}
98 98
 
99 99
 	/**
@@ -103,23 +103,23 @@  discard block
 block discarded – undo
103 103
 	 * @param boolean $before
104 104
 	 * @return HtmlButtonGroups
105 105
 	 */
106
-	public function addContentButtons($elements=array(), $asIcons=false,$part="extra",$before=false){
107
-		return $this->content["content"]->addContentButtons($elements,$asIcons,$part, $before);
106
+	public function addContentButtons($elements=array(), $asIcons=false, $part="extra", $before=false) {
107
+		return $this->content["content"]->addContentButtons($elements, $asIcons, $part, $before);
108 108
 	}
109 109
 
110 110
 
111 111
 
112
-	public function addItemHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) {
113
-		return $this->content["content"]->addHeaderContent($header, $metas, $description,$extra);
112
+	public function addItemHeaderContent($header, $metas=array(), $description=NULL, $extra=NULL) {
113
+		return $this->content["content"]->addHeaderContent($header, $metas, $description, $extra);
114 114
 	}
115 115
 
116 116
 	public function addItemContent($content=array()) {
117 117
 		$count=\sizeof($this->content);
118
-		return $this->addElementIn("content", new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content));
118
+		return $this->addElementIn("content", new HtmlViewContent("content-".$count."-".$this->identifier, $content));
119 119
 	}
120 120
 
121 121
 	public function getItemContent() {
122
-		return $this->getPart("content",null,true);
122
+		return $this->getPart("content", null, true);
123 123
 	}
124 124
 
125 125
 	public function getItemExtraContent() {
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 	 * @see HtmlSemDoubleElement::compile()
142 142
 	 */
143 143
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
144
-		$this->content=JArray::sortAssociative($this->content, ["header","image","icon","content","extra-content"]);
144
+		$this->content=JArray::sortAssociative($this->content, ["header", "image", "icon", "content", "extra-content"]);
145 145
 		return parent::compile($js, $view);
146 146
 	}
147 147
 
148
-	public function asLink($href="",$target=NULL) {
148
+	public function asLink($href="", $target=NULL) {
149 149
 		$this->addToProperty("class", "link");
150
-		if ($href !== "") {
150
+		if ($href!=="") {
151 151
 			$this->setProperty("href", $href);
152 152
 			if (isset($target))
153 153
 				$this->setProperty("target", $target);
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlDropdownItem.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -12,34 +12,34 @@  discard block
 block discarded – undo
12 12
 use Ajax\semantic\html\base\traits\MenuItemTrait;
13 13
 
14 14
 class HtmlDropdownItem extends HtmlSemDoubleElement {
15
-	use IconTrait,MenuItemTrait;
16
-	public function __construct($identifier, $content="",$value=NULL,$image=NULL,$description=NULL) {
15
+	use IconTrait, MenuItemTrait;
16
+	public function __construct($identifier, $content="", $value=NULL, $image=NULL, $description=NULL) {
17 17
 		parent::__construct($identifier, "a");
18 18
 		$this->setClass("item");
19 19
 		$this->setContent($content);
20
-		if($value!==NULL)
20
+		if ($value!==NULL)
21 21
 			$this->setData($value);
22
-		if($image!==NULL)
22
+		if ($image!==NULL)
23 23
 			$this->asMiniAvatar($image);
24
-		if($description!==NULL)
24
+		if ($description!==NULL)
25 25
 			$this->setDescription($description);
26 26
 	}
27 27
 
28
-	public function setDescription($description){
29
-		$descO=new HtmlDoubleElement("desc-".$this->identifier,"span");
28
+	public function setDescription($description) {
29
+		$descO=new HtmlDoubleElement("desc-".$this->identifier, "span");
30 30
 		$descO->setClass("description");
31 31
 		$descO->setContent($description);
32
-		return $this->addContent($descO,true);
32
+		return $this->addContent($descO, true);
33 33
 	}
34 34
 
35
-	public function setData($value){
35
+	public function setData($value) {
36 36
 		$this->setProperty("data-value", $value);
37 37
 		return $this;
38 38
 	}
39 39
 
40
-	public function asOption(){
40
+	public function asOption() {
41 41
 		$this->tagName="option";
42
-		if($this->getProperty("data-value")!==null)
42
+		if ($this->getProperty("data-value")!==null)
43 43
 			$this->setProperty("value", $this->getProperty("data-value"));
44 44
 	}
45 45
 
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	 * @param string $image the image src
48 48
 	 * @return $this
49 49
 	 */
50
-	public function asMiniAvatar($image){
50
+	public function asMiniAvatar($image) {
51 51
 		$this->tagName="div";
52
-		$img=new HtmlImg("image-".$this->identifier,$image);
52
+		$img=new HtmlImg("image-".$this->identifier, $image);
53 53
 		$img->setClass("ui mini avatar image");
54
-		$this->addContent($img,true);
54
+		$this->addContent($img, true);
55 55
 		return $this;
56 56
 	}
57 57
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 * @param string $icon
61 61
 	 * @return HtmlDropdownItem
62 62
 	 */
63
-	public function asIcon($caption,$icon){
63
+	public function asIcon($caption, $icon) {
64 64
 		$this->setContent($caption);
65
-		$this->addContent(new HtmlIcon("", $icon),true);
65
+		$this->addContent(new HtmlIcon("", $icon), true);
66 66
 		return $this;
67 67
 	}
68 68
 
@@ -71,23 +71,23 @@  discard block
 block discarded – undo
71 71
 	 * @param string $color
72 72
 	 * @return HtmlDropdownItem
73 73
 	 */
74
-	public function asCircularLabel($caption,$color){
74
+	public function asCircularLabel($caption, $color) {
75 75
 		$this->setContent($caption);
76 76
 		$lbl=new HtmlLabel("");
77 77
 		$lbl->setCircular()->setColor($color)->setEmpty();
78
-		$this->addContent($lbl,true);
78
+		$this->addContent($lbl, true);
79 79
 		return $this;
80 80
 	}
81 81
 
82 82
 
83 83
 
84 84
 	public function addMenuItem($items) {
85
-		$menu=new HtmlMenu("menu-" . $this->identifier, $items);
85
+		$menu=new HtmlMenu("menu-".$this->identifier, $items);
86 86
 		$content=$this->content;
87 87
 		$this->setTagName("div");
88 88
 		$this->setProperty("class", "item");
89 89
 		$icon=new HtmlIcon("", "dropdown");
90
-		$this->content=[$icon,new HtmlSemDoubleElement("","span","text",$content),$menu];
90
+		$this->content=[$icon, new HtmlSemDoubleElement("", "span", "text", $content), $menu];
91 91
 		return $menu;
92 92
 	}
93 93
 
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 	 * @param string $icon
97 97
 	 * @return HtmlDropdownItem
98 98
 	 */
99
-	public static function searchInput($placeholder=NULL,$icon=NULL){
100
-		return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon);
99
+	public static function searchInput($placeholder=NULL, $icon=NULL) {
100
+		return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon);
101 101
 	}
102 102
 
103 103
 	/**
104 104
 	 * @return HtmlDropdownItem
105 105
 	 */
106
-	public static function divider(){
106
+	public static function divider() {
107 107
 		return (new HtmlDropdownItem(""))->asDivider();
108 108
 	}
109 109
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * @param string $icon
113 113
 	 * @return HtmlDropdownItem
114 114
 	 */
115
-	public static function header($caption=NULL,$icon=NULL){
116
-		return (new HtmlDropdownItem(""))->asHeader($caption,$icon);
115
+	public static function header($caption=NULL, $icon=NULL) {
116
+		return (new HtmlDropdownItem(""))->asHeader($caption, $icon);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 * @param string $color
122 122
 	 * @return HtmlDropdownItem
123 123
 	 */
124
-	public static function circular($caption,$color){
125
-		return (new HtmlDropdownItem(""))->asCircularLabel($caption,$color);
124
+	public static function circular($caption, $color) {
125
+		return (new HtmlDropdownItem(""))->asCircularLabel($caption, $color);
126 126
 	}
127 127
 
128 128
 	/**
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 	 * @param string $icon
131 131
 	 * @return HtmlDropdownItem
132 132
 	 */
133
-	public static function icon($caption,$icon){
134
-		return (new HtmlDropdownItem(""))->asIcon($caption,$icon);
133
+	public static function icon($caption, $icon) {
134
+		return (new HtmlDropdownItem(""))->asIcon($caption, $icon);
135 135
 	}
136 136
 
137 137
 	/**
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 	 * @param string $image
140 140
 	 * @return HtmlDropdownItem
141 141
 	 */
142
-	public static function avatar($caption,$image){
143
-		$dd=new HtmlDropdownItem("",$caption);
142
+	public static function avatar($caption, $image) {
143
+		$dd=new HtmlDropdownItem("", $caption);
144 144
 		$dd->asMiniAvatar($image);
145 145
 		return $dd;
146 146
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Spacing   +7 added lines, -7 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
 
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 
106 106
 
107 107
 	public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) {
108
-		$fields=array ();
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", "");
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 	}
122 122
 
123 123
 	public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
124
-		$fields=array ();
124
+		$fields=array();
125 125
 		$i=0;
126
-		foreach ( $items as $val => $caption ) {
126
+		foreach ($items as $val => $caption) {
127 127
 			$itemO=new HtmlFormCheckbox($name."-".$i++, $caption, $val, $type);
128 128
 			$itemO->setName($name);
129 129
 			if (\array_search($val, $values)!==false) {
Please login to merge, or discard this patch.