@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | foreach ($items as $k=>$v){ |
| 25 | 25 | $this->addItem([$k,$v]); |
| 26 | 26 | } |
| 27 | - }else{ |
|
| 27 | + } else{ |
|
| 28 | 28 | foreach ($items as $item){ |
| 29 | 29 | $this->addItem($item); |
| 30 | 30 | } |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | * @return \Ajax\common\html\HtmlDoubleElement |
| 81 | 81 | */ |
| 82 | 82 | public function getItem($index) { |
| 83 | - if (is_int($index)&& isset($this->content[$index])) |
|
| 84 | - return $this->content[$index]; |
|
| 85 | - else { |
|
| 83 | + if (is_int($index)&& isset($this->content[$index])) { |
|
| 84 | + return $this->content[$index]; |
|
| 85 | + } else { |
|
| 86 | 86 | $elm=$this->getElementById($index, $this->content); |
| 87 | 87 | return $elm; |
| 88 | 88 | } |
@@ -144,10 +144,11 @@ discard block |
||
| 144 | 144 | $i=0; |
| 145 | 145 | foreach ($properties as $k=>$v){ |
| 146 | 146 | $c=$this->content[$i++]; |
| 147 | - if(isset($c)) |
|
| 148 | - $c->setProperty($k,$v); |
|
| 149 | - else |
|
| 150 | - return $this; |
|
| 147 | + if(isset($c)) { |
|
| 148 | + $c->setProperty($k,$v); |
|
| 149 | + } else { |
|
| 150 | + return $this; |
|
| 151 | + } |
|
| 151 | 152 | } |
| 152 | 153 | return $this; |
| 153 | 154 | } |
@@ -165,8 +166,7 @@ discard block |
||
| 165 | 166 | foreach ($values as $i=>$value){ |
| 166 | 167 | if(isset($this->content[$i])){ |
| 167 | 168 | $this->content[$i]->setProperty($property,$value); |
| 168 | - } |
|
| 169 | - else{ |
|
| 169 | + } else{ |
|
| 170 | 170 | return $this; |
| 171 | 171 | } |
| 172 | 172 | } |
@@ -186,8 +186,7 @@ discard block |
||
| 186 | 186 | foreach ($values as $i=>$value){ |
| 187 | 187 | if(isset($this->content[$i])){ |
| 188 | 188 | $this->content[$i++]->addToProperty($property,$value); |
| 189 | - } |
|
| 190 | - else{ |
|
| 189 | + } else{ |
|
| 191 | 190 | return $this; |
| 192 | 191 | } |
| 193 | 192 | } |
@@ -216,8 +215,9 @@ discard block |
||
| 216 | 215 | foreach ( $this->content as $index=>$item ) { |
| 217 | 216 | if($item instanceof HtmlDoubleElement){ |
| 218 | 217 | $href=""; |
| 219 | - if(isset($hrefs[$index])) |
|
| 220 | - $href=$hrefs[$index]; |
|
| 218 | + if(isset($hrefs[$index])) { |
|
| 219 | + $href=$hrefs[$index]; |
|
| 220 | + } |
|
| 221 | 221 | $item->asLink($href,$target); |
| 222 | 222 | } |
| 223 | 223 | } |
@@ -33,8 +33,9 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function getProperty($name) { |
| 36 | - if (array_key_exists($name, $this->_self->properties)) |
|
| 37 | - return $this->_self->properties[$name]; |
|
| 36 | + if (array_key_exists($name, $this->_self->properties)) { |
|
| 37 | + return $this->_self->properties[$name]; |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | /** |
@@ -76,8 +77,9 @@ discard block |
||
| 76 | 77 | } |
| 77 | 78 | |
| 78 | 79 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
| 79 | - if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) |
|
| 80 | - $typeCtrl=$typeCtrl::getConstants(); |
|
| 80 | + if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) { |
|
| 81 | + $typeCtrl=$typeCtrl::getConstants(); |
|
| 82 | + } |
|
| 81 | 83 | if (\is_array($typeCtrl)) { |
| 82 | 84 | $this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl); |
| 83 | 85 | } |
@@ -96,8 +98,9 @@ discard block |
||
| 96 | 98 | } |
| 97 | 99 | |
| 98 | 100 | public function removeProperty($name) { |
| 99 | - if (\array_key_exists($name, $this->_self->properties)) |
|
| 100 | - unset($this->_self->properties[$name]); |
|
| 101 | + if (\array_key_exists($name, $this->_self->properties)) { |
|
| 102 | + unset($this->_self->properties[$name]); |
|
| 103 | + } |
|
| 101 | 104 | return $this; |
| 102 | 105 | } |
| 103 | 106 | |
@@ -110,8 +113,9 @@ discard block |
||
| 110 | 113 | } |
| 111 | 114 | |
| 112 | 115 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 113 | - if ($this->_self->ctrl($name, $value, $typeCtrl) === true) |
|
| 114 | - return $this->_self->setProperty($name, $value); |
|
| 116 | + if ($this->_self->ctrl($name, $value, $typeCtrl) === true) { |
|
| 117 | + return $this->_self->setProperty($name, $value); |
|
| 118 | + } |
|
| 115 | 119 | return $this; |
| 116 | 120 | } |
| 117 | 121 | |