@@ -109,15 +109,18 @@ discard block |
||
| 109 | 109 | $flag=false; |
| 110 | 110 | $index=0; |
| 111 | 111 | while ( !$flag && $index < sizeof($elements) ) { |
| 112 | - if ($elements[$index] instanceof BaseHtml) |
|
| 113 | - $flag=($callback($elements[$index])); |
|
| 112 | + if ($elements[$index] instanceof BaseHtml) { |
|
| 113 | + $flag=($callback($elements[$index])); |
|
| 114 | + } |
|
| 114 | 115 | $index++; |
| 115 | 116 | } |
| 116 | - if ($flag === true) |
|
| 117 | - return $elements[$index - 1]; |
|
| 117 | + if ($flag === true) { |
|
| 118 | + return $elements[$index - 1]; |
|
| 119 | + } |
|
| 118 | 120 | } elseif ($elements instanceof BaseHtml) { |
| 119 | - if ($callback($elements)) |
|
| 120 | - return $elements; |
|
| 121 | + if ($callback($elements)) { |
|
| 122 | + return $elements; |
|
| 123 | + } |
|
| 121 | 124 | } |
| 122 | 125 | return null; |
| 123 | 126 | } |
@@ -143,8 +146,9 @@ discard block |
||
| 143 | 146 | |
| 144 | 147 | public function fromArray($array) { |
| 145 | 148 | foreach ( $this as $key => $value ) { |
| 146 | - if(array_key_exists($key, $array)===true) |
|
| 147 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
| 149 | + if(array_key_exists($key, $array)===true) { |
|
| 150 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
| 151 | + } |
|
| 148 | 152 | } |
| 149 | 153 | foreach ( $array as $key => $value ) { |
| 150 | 154 | if($this->_callSetter($key, $key, $value, $array)===false){ |
@@ -213,9 +217,9 @@ discard block |
||
| 213 | 217 | if(\strstr($result, "%{$key}%")!==false){ |
| 214 | 218 | if (\is_array($value)) { |
| 215 | 219 | $v=PropertyWrapper::wrap($value, $js); |
| 216 | - }elseif($value instanceof \stdClass){ |
|
| 220 | + } elseif($value instanceof \stdClass){ |
|
| 217 | 221 | $v=\print_r($value,true); |
| 218 | - }else{ |
|
| 222 | + } else{ |
|
| 219 | 223 | $v=$value; |
| 220 | 224 | } |
| 221 | 225 | $result=str_replace("%{$key}%", $v, $result); |
@@ -25,8 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | private static function containsElement($input) { |
| 27 | 27 | foreach ( $input as $v ) { |
| 28 | - if (\is_object($v) || \is_array($v)) |
|
| 29 | - return true; |
|
| 28 | + if (\is_object($v) || \is_array($v)) { |
|
| 29 | + return true; |
|
| 30 | + } |
|
| 30 | 31 | } |
| 31 | 32 | return false; |
| 32 | 33 | } |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | * @param mixed $view |
| 17 | 17 | */ |
| 18 | 18 | protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){ |
| 19 | - if(isset($view)) |
|
| 20 | - $library->compileHtml($this, $view); |
|
| 19 | + if(isset($view)) { |
|
| 20 | + $library->compileHtml($this, $view); |
|
| 21 | + } |
|
| 21 | 22 | if ($library->isAutoCompile()) { |
| 22 | 23 | $library->compile(true); |
| 23 | 24 | } |
@@ -36,7 +37,9 @@ discard block |
||
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | protected function minify($input) { |
| 39 | - if(trim($input) === "") return $input; |
|
| 40 | + if(trim($input) === "") { |
|
| 41 | + return $input; |
|
| 42 | + } |
|
| 40 | 43 | return preg_replace( |
| 41 | 44 | array( |
| 42 | 45 | // Remove comment(s) |
@@ -120,25 +120,29 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | public function getColPosition($colIndex) { |
| 123 | - if($this->_container->_isMerged()!==true) |
|
| 124 | - return $colIndex; |
|
| 123 | + if($this->_container->_isMerged()!==true) { |
|
| 124 | + return $colIndex; |
|
| 125 | + } |
|
| 125 | 126 | $pos=0; |
| 126 | 127 | $rows=$this->_container->getContent(); |
| 127 | 128 | for($i=0; $i < $this->_row; $i++) { |
| 128 | 129 | $max=\min($colIndex, $rows[$i]->count()); |
| 129 | 130 | for($j=0; $j < $max; $j++) { |
| 130 | 131 | $rowspan=$rows[$i]->getItem($j)->getRowspan(); |
| 131 | - if ($rowspan + $i > $this->_row) |
|
| 132 | - $pos++; |
|
| 132 | + if ($rowspan + $i > $this->_row) { |
|
| 133 | + $pos++; |
|
| 134 | + } |
|
| 133 | 135 | } |
| 134 | 136 | } |
| 135 | - if ($pos > $colIndex) |
|
| 136 | - return NULL; |
|
| 137 | + if ($pos > $colIndex) { |
|
| 138 | + return NULL; |
|
| 139 | + } |
|
| 137 | 140 | $count=$this->count(); |
| 138 | 141 | for($i=0; $i < $count; $i++) { |
| 139 | 142 | $pos+=$this->content[$i]->getColspan(); |
| 140 | - if ($pos >= $colIndex + 1) |
|
| 141 | - return $i; |
|
| 143 | + if ($pos >= $colIndex + 1) { |
|
| 144 | + return $i; |
|
| 145 | + } |
|
| 142 | 146 | } |
| 143 | 147 | return null; |
| 144 | 148 | } |
@@ -161,8 +165,9 @@ discard block |
||
| 161 | 165 | public function containsStr($needle) { |
| 162 | 166 | $cells=$this->content; |
| 163 | 167 | foreach ( $cells as $cell ) { |
| 164 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
| 165 | - return true; |
|
| 168 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
| 169 | + return true; |
|
| 170 | + } |
|
| 166 | 171 | } |
| 167 | 172 | return false; |
| 168 | 173 | } |