@@ -50,8 +50,9 @@ discard block |
||
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=" ") { |
@@ -61,10 +62,11 @@ discard block |
||
61 | 62 | } |
62 | 63 | } else if ($value !== "" && $this->propertyContains($name, $value) === false) { |
63 | 64 | $v=@$this->properties[$name]; |
64 | - if (isset($v) && $v !== "") |
|
65 | - $v=$v . $separator . $value; |
|
66 | - else |
|
67 | - $v=$value; |
|
65 | + if (isset($v) && $v !== "") { |
|
66 | + $v=$v . $separator . $value; |
|
67 | + } else { |
|
68 | + $v=$value; |
|
69 | + } |
|
68 | 70 | |
69 | 71 | return $this->setProperty($name, $v); |
70 | 72 | } |
@@ -119,8 +121,9 @@ discard block |
||
119 | 121 | } |
120 | 122 | |
121 | 123 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
122 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
123 | - return $this->setProperty($name, $value); |
|
124 | + if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
125 | + return $this->setProperty($name, $value); |
|
126 | + } |
|
124 | 127 | return $this; |
125 | 128 | } |
126 | 129 | |
@@ -150,8 +153,9 @@ discard block |
||
150 | 153 | } |
151 | 154 | |
152 | 155 | public function removeProperty($name) { |
153 | - if (\array_key_exists($name, $this->properties)) |
|
154 | - unset($this->properties[$name]); |
|
156 | + if (\array_key_exists($name, $this->properties)) { |
|
157 | + unset($this->properties[$name]); |
|
158 | + } |
|
155 | 159 | return $this; |
156 | 160 | } |
157 | 161 | |
@@ -171,8 +175,9 @@ discard block |
||
171 | 175 | } |
172 | 176 | |
173 | 177 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
174 | - if (@class_exists($typeCtrl, true)) |
|
175 | - $typeCtrl=$typeCtrl::getConstants(); |
|
178 | + if (@class_exists($typeCtrl, true)) { |
|
179 | + $typeCtrl=$typeCtrl::getConstants(); |
|
180 | + } |
|
176 | 181 | if (is_array($typeCtrl)) { |
177 | 182 | $this->removeOldValues($this->properties[$name], $typeCtrl); |
178 | 183 | } |
@@ -213,8 +218,9 @@ discard block |
||
213 | 218 | |
214 | 219 | public function fromArray($array) { |
215 | 220 | foreach ( $this as $key => $value ) { |
216 | - if(array_key_exists($key, $array)===true) |
|
217 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
221 | + if(array_key_exists($key, $array)===true) { |
|
222 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
223 | + } |
|
218 | 224 | } |
219 | 225 | foreach ( $array as $key => $value ) { |
220 | 226 | if($this->_callSetter($key, $key, $value, $array)===false){ |
@@ -265,15 +271,18 @@ discard block |
||
265 | 271 | $flag=false; |
266 | 272 | $index=0; |
267 | 273 | while ( !$flag && $index < sizeof($elements) ) { |
268 | - if ($elements[$index] instanceof BaseHtml) |
|
269 | - $flag=($elements[$index]->getIdentifier() === $identifier); |
|
274 | + if ($elements[$index] instanceof BaseHtml) { |
|
275 | + $flag=($elements[$index]->getIdentifier() === $identifier); |
|
276 | + } |
|
270 | 277 | $index++; |
271 | 278 | } |
272 | - if ($flag === true) |
|
273 | - return $elements[$index - 1]; |
|
279 | + if ($flag === true) { |
|
280 | + return $elements[$index - 1]; |
|
281 | + } |
|
274 | 282 | } elseif ($elements instanceof BaseHtml) { |
275 | - if ($elements->getIdentifier() === $identifier) |
|
276 | - return $elements; |
|
283 | + if ($elements->getIdentifier() === $identifier) { |
|
284 | + return $elements; |
|
285 | + } |
|
277 | 286 | } |
278 | 287 | return null; |
279 | 288 | } |
@@ -283,15 +292,18 @@ discard block |
||
283 | 292 | $flag=false; |
284 | 293 | $index=0; |
285 | 294 | while ( !$flag && $index < sizeof($elements) ) { |
286 | - if ($elements[$index] instanceof BaseHtml) |
|
287 | - $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
295 | + if ($elements[$index] instanceof BaseHtml) { |
|
296 | + $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
297 | + } |
|
288 | 298 | $index++; |
289 | 299 | } |
290 | - if ($flag === true) |
|
291 | - return $elements[$index - 1]; |
|
300 | + if ($flag === true) { |
|
301 | + return $elements[$index - 1]; |
|
302 | + } |
|
292 | 303 | } elseif ($elements instanceof BaseHtml) { |
293 | - if ($elements->propertyContains($propertyName, $value) === true) |
|
294 | - return $elements; |
|
304 | + if ($elements->propertyContains($propertyName, $value) === true) { |
|
305 | + return $elements; |
|
306 | + } |
|
295 | 307 | } |
296 | 308 | return null; |
297 | 309 | } |