@@ -128,8 +128,9 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function fromArray($array) { |
| 130 | 130 | foreach ( $this as $key => $value ) { |
| 131 | - if(array_key_exists($key, $array)===true) |
|
| 132 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
| 131 | + if(array_key_exists($key, $array)===true) { |
|
| 132 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
| 133 | + } |
|
| 133 | 134 | } |
| 134 | 135 | foreach ( $array as $key => $value ) { |
| 135 | 136 | if($this->_callSetter($key, $key, $value, $array)===false){ |
@@ -180,15 +181,18 @@ discard block |
||
| 180 | 181 | $flag=false; |
| 181 | 182 | $index=0; |
| 182 | 183 | while ( !$flag && $index < sizeof($elements) ) { |
| 183 | - if ($elements[$index] instanceof BaseHtml) |
|
| 184 | - $flag=($elements[$index]->getIdentifier() === $identifier); |
|
| 184 | + if ($elements[$index] instanceof BaseHtml) { |
|
| 185 | + $flag=($elements[$index]->getIdentifier() === $identifier); |
|
| 186 | + } |
|
| 185 | 187 | $index++; |
| 186 | 188 | } |
| 187 | - if ($flag === true) |
|
| 188 | - return $elements[$index - 1]; |
|
| 189 | + if ($flag === true) { |
|
| 190 | + return $elements[$index - 1]; |
|
| 191 | + } |
|
| 189 | 192 | } elseif ($elements instanceof BaseHtml) { |
| 190 | - if ($elements->getIdentifier() === $identifier) |
|
| 191 | - return $elements; |
|
| 193 | + if ($elements->getIdentifier() === $identifier) { |
|
| 194 | + return $elements; |
|
| 195 | + } |
|
| 192 | 196 | } |
| 193 | 197 | return null; |
| 194 | 198 | } |
@@ -26,8 +26,9 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function getProperty($name) { |
| 29 | - if (array_key_exists($name, $this->properties)) |
|
| 30 | - return $this->properties[$name]; |
|
| 29 | + if (array_key_exists($name, $this->properties)) { |
|
| 30 | + return $this->properties[$name]; |
|
| 31 | + } |
|
| 31 | 32 | } |
| 32 | 33 | |
| 33 | 34 | public function addToProperty($name, $value, $separator=" ") { |
@@ -37,10 +38,11 @@ discard block |
||
| 37 | 38 | } |
| 38 | 39 | } else if ($value !== "" && $this->propertyContains($name, $value) === false) { |
| 39 | 40 | $v=@$this->properties[$name]; |
| 40 | - if (isset($v) && $v !== "") |
|
| 41 | - $v=$v . $separator . $value; |
|
| 42 | - else |
|
| 43 | - $v=$value; |
|
| 41 | + if (isset($v) && $v !== "") { |
|
| 42 | + $v=$v . $separator . $value; |
|
| 43 | + } else { |
|
| 44 | + $v=$value; |
|
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | return $this->setProperty($name, $v); |
| 46 | 48 | } |
@@ -63,8 +65,9 @@ discard block |
||
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
| 66 | - if (@class_exists($typeCtrl, true)) |
|
| 67 | - $typeCtrl=$typeCtrl::getConstants(); |
|
| 68 | + if (@class_exists($typeCtrl, true)) { |
|
| 69 | + $typeCtrl=$typeCtrl::getConstants(); |
|
| 70 | + } |
|
| 68 | 71 | if (\is_array($typeCtrl)) { |
| 69 | 72 | $this->removeOldValues($this->properties[$name], $typeCtrl); |
| 70 | 73 | } |
@@ -83,8 +86,9 @@ discard block |
||
| 83 | 86 | } |
| 84 | 87 | |
| 85 | 88 | public function removeProperty($name) { |
| 86 | - if (\array_key_exists($name, $this->properties)) |
|
| 87 | - unset($this->properties[$name]); |
|
| 89 | + if (\array_key_exists($name, $this->properties)) { |
|
| 90 | + unset($this->properties[$name]); |
|
| 91 | + } |
|
| 88 | 92 | return $this; |
| 89 | 93 | } |
| 90 | 94 | |
@@ -97,8 +101,9 @@ discard block |
||
| 97 | 101 | } |
| 98 | 102 | |
| 99 | 103 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 100 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
| 101 | - return $this->setProperty($name, $value); |
|
| 104 | + if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
| 105 | + return $this->setProperty($name, $value); |
|
| 106 | + } |
|
| 102 | 107 | return $this; |
| 103 | 108 | } |
| 104 | 109 | |
@@ -107,15 +112,18 @@ discard block |
||
| 107 | 112 | $flag=false; |
| 108 | 113 | $index=0; |
| 109 | 114 | while ( !$flag && $index < sizeof($elements) ) { |
| 110 | - if ($elements[$index] instanceof BaseHtml) |
|
| 111 | - $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
| 115 | + if ($elements[$index] instanceof BaseHtml) { |
|
| 116 | + $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
| 117 | + } |
|
| 112 | 118 | $index++; |
| 113 | 119 | } |
| 114 | - if ($flag === true) |
|
| 115 | - return $elements[$index - 1]; |
|
| 120 | + if ($flag === true) { |
|
| 121 | + return $elements[$index - 1]; |
|
| 122 | + } |
|
| 116 | 123 | } elseif ($elements instanceof BaseHtml) { |
| 117 | - if ($elements->propertyContains($propertyName, $value) === true) |
|
| 118 | - return $elements; |
|
| 124 | + if ($elements->propertyContains($propertyName, $value) === true) { |
|
| 125 | + return $elements; |
|
| 126 | + } |
|
| 119 | 127 | } |
| 120 | 128 | return null; |
| 121 | 129 | } |