Completed
Push — master ( 3ded41...1b9fb1 )
by Jean-Christophe
03:08
created
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function getProperty($name) {
36
-		if (array_key_exists($name, $this->properties))
37
-			return $this->properties[$name];
36
+		if (array_key_exists($name, $this->properties)) {
37
+					return $this->properties[$name];
38
+		}
38 39
 	}
39 40
 
40 41
 	public function addToProperty($name, $value, $separator=" ") {
@@ -44,10 +45,11 @@  discard block
 block discarded – undo
44 45
 			}
45 46
 		} else if ($value !== "" && $this->propertyContains($name, $value) === false) {
46 47
 			$v=@$this->properties[$name];
47
-			if (isset($v) && $v !== "")
48
-				$v=$v . $separator . $value;
49
-				else
50
-					$v=$value;
48
+			if (isset($v) && $v !== "") {
49
+							$v=$v . $separator . $value;
50
+			} else {
51
+									$v=$value;
52
+				}
51 53
 
52 54
 					return $this->setProperty($name, $v);
53 55
 		}
@@ -70,8 +72,9 @@  discard block
 block discarded – undo
70 72
 	}
71 73
 
72 74
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
73
-		if (@class_exists($typeCtrl, true))
74
-			$typeCtrl=$typeCtrl::getConstants();
75
+		if (@class_exists($typeCtrl, true)) {
76
+					$typeCtrl=$typeCtrl::getConstants();
77
+		}
75 78
 			if (\is_array($typeCtrl)) {
76 79
 				$this->removeOldValues($this->properties[$name], $typeCtrl);
77 80
 			}
@@ -90,8 +93,9 @@  discard block
 block discarded – undo
90 93
 	}
91 94
 
92 95
 	public function removeProperty($name) {
93
-		if (\array_key_exists($name, $this->properties))
94
-			unset($this->properties[$name]);
96
+		if (\array_key_exists($name, $this->properties)) {
97
+					unset($this->properties[$name]);
98
+		}
95 99
 			return $this;
96 100
 	}
97 101
 
@@ -104,8 +108,9 @@  discard block
 block discarded – undo
104 108
 	}
105 109
 
106 110
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
107
-		if ($this->ctrl($name, $value, $typeCtrl) === true)
108
-			return $this->setProperty($name, $value);
111
+		if ($this->ctrl($name, $value, $typeCtrl) === true) {
112
+					return $this->setProperty($name, $value);
113
+		}
109 114
 			return $this;
110 115
 	}
111 116
 
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,15 +99,18 @@  discard block
 block discarded – undo
99 99
 			$flag=false;
100 100
 			$index=0;
101 101
 			while ( !$flag && $index < sizeof($elements) ) {
102
-				if ($elements[$index] instanceof BaseHtml)
103
-					$flag=($callback($elements[$index]));
102
+				if ($elements[$index] instanceof BaseHtml) {
103
+									$flag=($callback($elements[$index]));
104
+				}
104 105
 					$index++;
105 106
 			}
106
-			if ($flag === true)
107
-				return $elements[$index - 1];
107
+			if ($flag === true) {
108
+							return $elements[$index - 1];
109
+			}
108 110
 		} elseif ($elements instanceof BaseHtml) {
109
-			if ($callback($elements))
110
-				return $elements;
111
+			if ($callback($elements)) {
112
+							return $elements;
113
+			}
111 114
 		}
112 115
 		return null;
113 116
 	}
@@ -140,8 +143,9 @@  discard block
 block discarded – undo
140 143
 
141 144
 	public function fromArray($array) {
142 145
 		foreach ( $this as $key => $value ) {
143
-			if(array_key_exists($key, $array)===true)
144
-				$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
146
+			if(array_key_exists($key, $array)===true) {
147
+							$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
148
+			}
145 149
 		}
146 150
 		foreach ( $array as $key => $value ) {
147 151
 			if($this->_callSetter($key, $key, $value, $array)===false){
Please login to merge, or discard this patch.