Completed
Push — master ( d88325...fa0c00 )
by Jean-Christophe
03:31
created
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,10 +55,11 @@
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setDismissable($dismiss=true){
58
-		if($dismiss===true)
59
-			$this->close=new HtmlIcon("close-".$this->identifier, "close");
60
-		else
61
-			$this->close=NULL;
58
+		if($dismiss===true) {
59
+					$this->close=new HtmlIcon("close-".$this->identifier, "close");
60
+		} else {
61
+					$this->close=NULL;
62
+		}
62 63
 		return $this;
63 64
 	}
64 65
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridCol.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@
 block discarded – undo
9 9
 	public function __construct($identifier,$width){
10 10
 		parent::__construct($identifier,"div");
11 11
 		$this->setClass("column");
12
-		if(isset($width))
13
-			$this->setWidth($width);
12
+		if(isset($width)) {
13
+					$this->setWidth($width);
14
+		}
14 15
 	}
15 16
 
16 17
 	public function setWidth($width){
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridRow.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@
 block discarded – undo
14 14
 		if(isset($numCols)){
15 15
 			$numCols=min(16,$numCols);
16 16
 			$numCols=max(1,$numCols);
17
-			if($colSizing)
18
-				$width=(int)(16/$numCols);
19
-			else
20
-				$this->_colSize=16/$numCols;
17
+			if($colSizing) {
18
+							$width=(int)(16/$numCols);
19
+			} else {
20
+							$this->_colSize=16/$numCols;
21
+			}
21 22
 			for ($i=0;$i<$numCols;$i++){
22 23
 				$this->addItem($width);
23 24
 			}
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 			foreach ($items as $k=>$v){
18 18
 				$this->addItem([$k,$v]);
19 19
 			}
20
-		}else{
20
+		} else{
21 21
 			foreach ($items as $item){
22 22
 				$this->addItem($item);
23 23
 			}
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 * @return \Ajax\common\html\HtmlDoubleElement
54 54
 	 */
55 55
 	public function getItem($index) {
56
-		if (is_int($index))
57
-			return $this->content[$index];
58
-		else {
56
+		if (is_int($index)) {
57
+					return $this->content[$index];
58
+		} else {
59 59
 			$elm=$this->getElementById($index, $this->content);
60 60
 			return $elm;
61 61
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlHeader.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
 		if(isset($type)){
16 16
 			if($type=="page"){
17 17
 				$this->asPageHeader($niveau);
18
-			}else
19
-				$this->asContentHeader($niveau);
18
+			} else {
19
+							$this->asContentHeader($niveau);
20
+			}
20 21
 		}
21 22
 		$this->content=$content;
22 23
 	}
@@ -48,7 +49,7 @@  discard block
 block discarded – undo
48 49
 		if(!\is_object($title)){
49 50
 			$this->content=new HtmlDoubleElement("content-".$this->identifier,"div");
50 51
 			$this->content->setContent($title);
51
-		}else{
52
+		} else{
52 53
 			$this->content=$title;
53 54
 		}
54 55
 		$this->content->setClass("content");
Please login to merge, or discard this patch.
Ajax/common/BaseEnum.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public static function getConstantValues($postFix=""){
27
-		if($postFix!=="")
28
-			return \array_values(self::getConstants());
29
-		else{
27
+		if($postFix!=="") {
28
+					return \array_values(self::getConstants());
29
+		} else{
30 30
 			return \array_map(function ($elem) use ($postFix) {return $elem." ".$postFix;},\array_values(self::getConstants()));
31 31
 		}
32 32
 	}
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -50,16 +50,18 @@  discard block
 block discarded – undo
50 50
 	}
51 51
 
52 52
 	public function getProperty($name) {
53
-		if (array_key_exists($name, $this->properties))
54
-			return $this->properties [$name];
53
+		if (array_key_exists($name, $this->properties)) {
54
+					return $this->properties [$name];
55
+		}
55 56
 	}
56 57
 
57 58
 	public function addToProperty($name, $value, $separator=" ") {
58 59
 		$v=@$this->properties[$name];
59
-		if (isset($v)&&$v!=="")
60
-			$v=$v.$separator.$value;
61
-		else
62
-			$v=$value;
60
+		if (isset($v)&&$v!=="") {
61
+					$v=$v.$separator.$value;
62
+		} else {
63
+					$v=$value;
64
+		}
63 65
 
64 66
 		return $this->setProperty($name, $v);
65 67
 	}
@@ -117,8 +119,9 @@  discard block
 block discarded – undo
117 119
 	}
118 120
 
119 121
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
120
-		if ($this->ctrl($name, $value, $typeCtrl)===true)
121
-			return $this->setProperty($name, $value);
122
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
123
+					return $this->setProperty($name, $value);
124
+		}
122 125
 		return $this;
123 126
 	}
124 127
 
@@ -143,8 +146,9 @@  discard block
 block discarded – undo
143 146
 	}
144 147
 
145 148
 	protected function removeProperty($name){
146
-		if(\array_key_exists($name, $this->properties))
147
-			unset($this->properties[$name]);
149
+		if(\array_key_exists($name, $this->properties)) {
150
+					unset($this->properties[$name]);
151
+		}
148 152
 		return $this;
149 153
 	}
150 154
 
@@ -164,8 +168,9 @@  discard block
 block discarded – undo
164 168
 	}
165 169
 
166 170
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
167
-		if (@class_exists($typeCtrl, true))
168
-			$typeCtrl=$typeCtrl::getConstants();
171
+		if (@class_exists($typeCtrl, true)) {
172
+					$typeCtrl=$typeCtrl::getConstants();
173
+		}
169 174
 		if (is_array($typeCtrl)) {
170 175
 			$this->removeOldValues($this->properties [$name], $typeCtrl);
171 176
 		}
@@ -348,15 +353,18 @@  discard block
 block discarded – undo
348 353
 			$flag=false;
349 354
 			$index=0;
350 355
 			while ( !$flag&&$index<sizeof($elements) ) {
351
-				if ($elements [$index] instanceof BaseHtml)
352
-					$flag=($elements [$index]->getIdentifier()===$identifier);
356
+				if ($elements [$index] instanceof BaseHtml) {
357
+									$flag=($elements [$index]->getIdentifier()===$identifier);
358
+				}
353 359
 				$index++;
354 360
 			}
355
-			if ($flag===true)
356
-				return $elements [$index-1];
361
+			if ($flag===true) {
362
+							return $elements [$index-1];
363
+			}
357 364
 		} elseif ($elements instanceof BaseHtml) {
358
-			if ($elements->getIdentifier()===$identifier)
359
-				return $elements;
365
+			if ($elements->getIdentifier()===$identifier) {
366
+							return $elements;
367
+			}
360 368
 		}
361 369
 		return null;
362 370
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlBreadcrumb.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -92,8 +92,9 @@  discard block
 block discarded – undo
92 92
 		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
93 93
 			$items[]=$action;
94 94
 			foreach ($params as $p){
95
-				if(\is_object($p)===false)
96
-					$items[]=$p;
95
+				if(\is_object($p)===false) {
96
+									$items[]=$p;
97
+				}
97 98
 			}
98 99
 		}
99 100
 		return $this->addItems($items);
@@ -111,7 +112,7 @@  discard block
 block discarded – undo
111 112
 		}
112 113
 		if($this->absolutePaths===true){
113 114
 			return $this->_hrefFunction($this->content[$index]);
114
-		}else{
115
+		} else{
115 116
 			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
116 117
 		}
117 118
 	}
@@ -165,8 +166,9 @@  discard block
 block discarded – undo
165 166
 
166 167
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
167 168
 		foreach ($this->content as $element){
168
-			if($element->getProperty($this->attr)!=NULL)
169
-				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
169
+			if($element->getProperty($this->attr)!=NULL) {
170
+							$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
171
+			}
170 172
 		}
171 173
 		return $this;
172 174
 	}
@@ -178,9 +180,9 @@  discard block
 block discarded – undo
178 180
 	protected function createItem($value) {
179 181
 		$count=$this->count();
180 182
 		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section");
181
-		if(\is_array($value))
182
-			$itemO->fromArray($value);
183
-		else{
183
+		if(\is_array($value)) {
184
+					$itemO->fromArray($value);
185
+		} else{
184 186
 			$itemO->setContent($value);
185 187
 			$itemO->setProperty($this->attr, $this->getHref($count));
186 188
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlInput.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,9 +32,10 @@  discard block
 block discarded – undo
32 32
 		$labelO=$label;
33 33
 		if(\is_object($label)===false){
34 34
 			$labelO=new HtmlLabel("label-".$this->identifier,$label);
35
-			if(isset($icon))
36
-				$labelO->addIcon($icon);
37
-		}else{
35
+			if(isset($icon)) {
36
+							$labelO->addIcon($icon);
37
+			}
38
+		} else{
38 39
 			$labelO->addToPropertyCtrl("class", "label", array("label"));
39 40
 		}
40 41
 		$this->addToProperty("class", $direction." labeled");
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
 		$actionO=$action;
51 52
 		if(\is_object($action)===false){
52 53
 			$actionO=new HtmlButton("action-".$this->identifier,$action);
53
-			if(isset($icon))
54
-				$actionO->addIcon($icon,true,$labeled);
54
+			if(isset($icon)) {
55
+							$actionO->addIcon($icon,true,$labeled);
56
+			}
55 57
 		}
56 58
 		$this->addToProperty("class", $direction." action");
57 59
 		$this->addContent($actionO,\strstr($direction,Direction::LEFT)!==false);
Please login to merge, or discard this patch.