@@ -20,35 +20,35 @@ discard block |
||
20 | 20 | * @property string $identifier |
21 | 21 | */ |
22 | 22 | trait FieldsTrait { |
23 | - abstract public function addFields($fields=NULL,$label=NULL); |
|
23 | + abstract public function addFields($fields=NULL, $label=NULL); |
|
24 | 24 | abstract public function addItem($item); |
25 | 25 | abstract public function getItem($index); |
26 | 26 | abstract public function count(); |
27 | 27 | |
28 | - protected function createItem($value){ |
|
29 | - if(\is_array($value)){ |
|
30 | - $itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null))); |
|
28 | + protected function createItem($value) { |
|
29 | + if (\is_array($value)) { |
|
30 | + $itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id", ""), JArray::getDefaultValue($value, "label", null), JArray::getDefaultValue($value, "type", "text"), JArray::getDefaultValue($value, "value", ""), JArray::getDefaultValue($value, "placeholder", JArray::getDefaultValue($value, "label", null))); |
|
31 | 31 | return $itemO; |
32 | - }elseif(\is_object($value)){ |
|
32 | + }elseif (\is_object($value)) { |
|
33 | 33 | $itemO=new HtmlFormField("field-".$this->identifier, $value); |
34 | 34 | return $itemO; |
35 | - }else |
|
35 | + } else |
|
36 | 36 | return new HtmlFormInput($value); |
37 | 37 | } |
38 | 38 | |
39 | - protected function createCondition($value){ |
|
39 | + protected function createCondition($value) { |
|
40 | 40 | return \is_object($value)===false || $value instanceof \Ajax\semantic\html\elements\HtmlInput; |
41 | 41 | } |
42 | 42 | |
43 | - public function addInputs($inputs,$fieldslabel=null){ |
|
43 | + public function addInputs($inputs, $fieldslabel=null) { |
|
44 | 44 | $fields=array(); |
45 | - foreach ($inputs as $input){ |
|
45 | + foreach ($inputs as $input) { |
|
46 | 46 | \extract($input); |
47 | - $f=new HtmlFormInput("",""); |
|
47 | + $f=new HtmlFormInput("", ""); |
|
48 | 48 | $f->fromArray($input); |
49 | 49 | $fields[]=$f; |
50 | 50 | } |
51 | - return $this->addFields($fields,$fieldslabel); |
|
51 | + return $this->addFields($fields, $fieldslabel); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -57,35 +57,35 @@ discard block |
||
57 | 57 | * @param array|mixed $values |
58 | 58 | * @return HtmlFormFields |
59 | 59 | */ |
60 | - public function setFieldsPropertyValues($property,$values){ |
|
60 | + public function setFieldsPropertyValues($property, $values) { |
|
61 | 61 | $i=0; |
62 | - if(\is_array($values)===false){ |
|
63 | - $values=\array_fill(0, $this->count(),$values); |
|
62 | + if (\is_array($values)===false) { |
|
63 | + $values=\array_fill(0, $this->count(), $values); |
|
64 | 64 | } |
65 | - foreach ($values as $value){ |
|
65 | + foreach ($values as $value) { |
|
66 | 66 | $c=$this->content[$i++]; |
67 | - if(isset($c)){ |
|
67 | + if (isset($c)) { |
|
68 | 68 | $df=$c->getDataField(); |
69 | - $df->setProperty($property,$value); |
|
69 | + $df->setProperty($property, $value); |
|
70 | 70 | } |
71 | - else{ |
|
71 | + else { |
|
72 | 72 | return $this; |
73 | 73 | } |
74 | 74 | } |
75 | 75 | return $this; |
76 | 76 | } |
77 | 77 | |
78 | - public function addFieldRule($index,$type,$prompt=NULL,$value=NULL){ |
|
78 | + public function addFieldRule($index, $type, $prompt=NULL, $value=NULL) { |
|
79 | 79 | $field=$this->getItem($index); |
80 | - if(isset($field)){ |
|
81 | - $field->addRule($type,$prompt,$value); |
|
80 | + if (isset($field)) { |
|
81 | + $field->addRule($type, $prompt, $value); |
|
82 | 82 | } |
83 | 83 | return $this; |
84 | 84 | } |
85 | 85 | |
86 | - public function addFieldRules($index,$rules){ |
|
86 | + public function addFieldRules($index, $rules) { |
|
87 | 87 | $field=$this->getItem($index); |
88 | - if(isset($field)){ |
|
88 | + if (isset($field)) { |
|
89 | 89 | $field->addRules($rules); |
90 | 90 | } |
91 | 91 | return $this; |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | * @param boolean $multiple |
101 | 101 | * @return HtmlFormDropdown |
102 | 102 | */ |
103 | - public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){ |
|
104 | - return $this->addItem(new HtmlFormDropdown($identifier,$items,$label,$value,$multiple)); |
|
103 | + public function addDropdown($identifier, $items=array(), $label=NULL, $value=NULL, $multiple=false) { |
|
104 | + return $this->addItem(new HtmlFormDropdown($identifier, $items, $label, $value, $multiple)); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * @param boolean $asIcons |
112 | 112 | * @return HtmlButtonGroups |
113 | 113 | */ |
114 | - public function addButtonGroups($identifier,$elements=[],$asIcons=false){ |
|
115 | - return $this->addItem(new HtmlButtonGroups($identifier,$elements,$asIcons)); |
|
114 | + public function addButtonGroups($identifier, $elements=[], $asIcons=false) { |
|
115 | + return $this->addItem(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | * @param string $icon |
125 | 125 | * @return HtmlButtonGroups |
126 | 126 | */ |
127 | - public function addDropdownButton($identifier,$value,$items=[],$asCombo=false,$icon=null){ |
|
128 | - return $this->addItem(HtmlButton::dropdown($identifier, $value,$items,$asCombo,$icon)); |
|
127 | + public function addDropdownButton($identifier, $value, $items=[], $asCombo=false, $icon=null) { |
|
128 | + return $this->addItem(HtmlButton::dropdown($identifier, $value, $items, $asCombo, $icon)); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | * @param string $placeholder |
137 | 137 | * @return HtmlFormInput |
138 | 138 | */ |
139 | - public function addInput($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL){ |
|
140 | - return $this->addItem(new HtmlFormInput($identifier,$label,$type,$value,$placeholder)); |
|
139 | + public function addInput($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) { |
|
140 | + return $this->addItem(new HtmlFormInput($identifier, $label, $type, $value, $placeholder)); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -148,22 +148,22 @@ discard block |
||
148 | 148 | * @param int $rows |
149 | 149 | * @return HtmlTextarea |
150 | 150 | */ |
151 | - public function addTextarea($identifier, $label,$value=NULL,$placeholder=NULL,$rows=5){ |
|
152 | - return $this->addItem(new HtmlFormTextarea($identifier,$label,$value,$placeholder,$rows)); |
|
151 | + public function addTextarea($identifier, $label, $value=NULL, $placeholder=NULL, $rows=5) { |
|
152 | + return $this->addItem(new HtmlFormTextarea($identifier, $label, $value, $placeholder, $rows)); |
|
153 | 153 | } |
154 | 154 | |
155 | - public function addPassword($identifier, $label=NULL){ |
|
156 | - return $this->addItem(new HtmlFormInput($identifier,$label,"password","","")); |
|
155 | + public function addPassword($identifier, $label=NULL) { |
|
156 | + return $this->addItem(new HtmlFormInput($identifier, $label, "password", "", "")); |
|
157 | 157 | } |
158 | 158 | |
159 | - public function addButton($identifier,$value,$cssStyle=NULL,$onClick=NULL){ |
|
160 | - return $this->addItem(new HtmlButton($identifier,$value,$cssStyle,$onClick)); |
|
159 | + public function addButton($identifier, $value, $cssStyle=NULL, $onClick=NULL) { |
|
160 | + return $this->addItem(new HtmlButton($identifier, $value, $cssStyle, $onClick)); |
|
161 | 161 | } |
162 | 162 | |
163 | - public function addButtonIcon($identifier,$icon,$cssStyle=NULL,$onClick=NULL){ |
|
163 | + public function addButtonIcon($identifier, $icon, $cssStyle=NULL, $onClick=NULL) { |
|
164 | 164 | $bt=new HtmlButton($identifier); |
165 | 165 | $bt->asIcon($icon); |
166 | - if(isset($onClick)) |
|
166 | + if (isset($onClick)) |
|
167 | 167 | $bt->onClick($onClick); |
168 | 168 | if (isset($cssStyle)) |
169 | 169 | $bt->addClass($cssStyle); |
@@ -177,16 +177,16 @@ discard block |
||
177 | 177 | * @param string $type |
178 | 178 | * @return HtmlFormCheckbox |
179 | 179 | */ |
180 | - public function addCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){ |
|
181 | - return $this->addItem(new HtmlFormCheckbox($identifier,$label,$value,$type)); |
|
180 | + public function addCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) { |
|
181 | + return $this->addItem(new HtmlFormCheckbox($identifier, $label, $value, $type)); |
|
182 | 182 | } |
183 | 183 | |
184 | - public function addRadio($identifier, $name,$label=NULL,$value=NULL){ |
|
185 | - return $this->addItem(new HtmlFormRadio($identifier,$name,$label,$value)); |
|
184 | + public function addRadio($identifier, $name, $label=NULL, $value=NULL) { |
|
185 | + return $this->addItem(new HtmlFormRadio($identifier, $name, $label, $value)); |
|
186 | 186 | } |
187 | 187 | |
188 | - public function addElement($identifier,$content,$label,$tagName="div",$baseClass=""){ |
|
189 | - $div=new HtmlSemDoubleElement($identifier,$tagName,$baseClass,$content); |
|
190 | - return $this->addItem(new HtmlFormField("field-".$identifier, $div,$label)); |
|
188 | + public function addElement($identifier, $content, $label, $tagName="div", $baseClass="") { |
|
189 | + $div=new HtmlSemDoubleElement($identifier, $tagName, $baseClass, $content); |
|
190 | + return $this->addItem(new HtmlFormField("field-".$identifier, $div, $label)); |
|
191 | 191 | } |
192 | 192 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | */ |
16 | 16 | class HtmlTableContent extends HtmlSemCollection { |
17 | - protected $_tdTagNames=[ "thead" => "th","tbody" => "td","tfoot" => "th" ]; |
|
17 | + protected $_tdTagNames=["thead" => "th", "tbody" => "td", "tfoot" => "th"]; |
|
18 | 18 | protected $_merged=false; |
19 | 19 | |
20 | 20 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function setRowCount($rowCount, $colCount) { |
40 | 40 | $count=$this->count(); |
41 | - for($i=$count; $i < $rowCount; $i++) { |
|
41 | + for ($i=$count; $i<$rowCount; $i++) { |
|
42 | 42 | $this->addItem($colCount); |
43 | 43 | } |
44 | 44 | return $this; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | return $this->_tdTagNames[$this->tagName]; |
49 | 49 | } |
50 | 50 | |
51 | - public function refreshTR(){ |
|
51 | + public function refreshTR() { |
|
52 | 52 | $this->_template="%wrapContentBefore%%content%%wrapContentAfter%"; |
53 | 53 | } |
54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $tr=new HtmlTR(""); |
65 | 65 | $tr->setContainer($this, $count); |
66 | 66 | $tr->setTdTagName($this->_tdTagNames[$this->tagName]); |
67 | - if (isset($value) === true) { |
|
67 | + if (isset($value)===true) { |
|
68 | 68 | $tr->setColCount($value); |
69 | 69 | } |
70 | 70 | return $tr; |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | return $this->addItem($row); |
91 | 91 | } |
92 | 92 | |
93 | - public function addMergeRow($colCount,$value=null){ |
|
93 | + public function addMergeRow($colCount, $value=null) { |
|
94 | 94 | $row=$this->addRow($colCount); |
95 | 95 | $row->mergeCol(); |
96 | - if(isset($value)){ |
|
96 | + if (isset($value)) { |
|
97 | 97 | $row->setValues([$value]); |
98 | 98 | } |
99 | 99 | return $row; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * @return HtmlTR |
104 | 104 | */ |
105 | - public function getItem($index){ |
|
105 | + public function getItem($index) { |
|
106 | 106 | return parent::getItem($index); |
107 | 107 | } |
108 | 108 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $row=$this->getItem($row); |
117 | 117 | if (isset($row) && $row instanceof HtmlCollection) { |
118 | 118 | $col=$row->getItem($col); |
119 | - }else{ |
|
119 | + } else { |
|
120 | 120 | $col=$row; |
121 | 121 | } |
122 | 122 | return $col; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function setCellValue($row, $col, $value="") { |
142 | 142 | $cell=$this->getCell($row, $col); |
143 | - if (isset($cell) === true) { |
|
143 | + if (isset($cell)===true) { |
|
144 | 144 | $cell->setValue($value); |
145 | 145 | } |
146 | 146 | return $this; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param mixed $values |
152 | 152 | */ |
153 | 153 | public function setValues($values=array()) { |
154 | - return $this->_addOrSetValues($values, function(HtmlTR $row,$_values){$row->setValues($_values);}); |
|
154 | + return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {$row->setValues($_values); }); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param mixed $values |
160 | 160 | */ |
161 | 161 | public function addValues($values=array()) { |
162 | - return $this->_addOrSetValues($values, function(HtmlTR $row,$_values){$row->addValues($_values);}); |
|
162 | + return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {$row->addValues($_values); }); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -167,21 +167,21 @@ discard block |
||
167 | 167 | * @param mixed $values |
168 | 168 | * @param callable $callback |
169 | 169 | */ |
170 | - protected function _addOrSetValues($values,$callback) { |
|
170 | + protected function _addOrSetValues($values, $callback) { |
|
171 | 171 | $count=$this->count(); |
172 | 172 | $isArray=true; |
173 | 173 | if (!\is_array($values)) { |
174 | 174 | $values=\array_fill(0, $count, $values); |
175 | 175 | $isArray=false; |
176 | 176 | } |
177 | - if (JArray::dimension($values) == 1 && $isArray) |
|
178 | - $values=[ $values ]; |
|
177 | + if (JArray::dimension($values)==1 && $isArray) |
|
178 | + $values=[$values]; |
|
179 | 179 | |
180 | 180 | $count=\min(\sizeof($values), $count); |
181 | 181 | |
182 | - for($i=0; $i < $count; $i++) { |
|
182 | + for ($i=0; $i<$count; $i++) { |
|
183 | 183 | $row=$this->content[$i]; |
184 | - $callback($row,$values[$i]); |
|
184 | + $callback($row, $values[$i]); |
|
185 | 185 | } |
186 | 186 | return $this; |
187 | 187 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $values=\array_fill(0, $count, $values); |
193 | 193 | } |
194 | 194 | $count=\min(\sizeof($values), $count); |
195 | - for($i=0; $i < $count; $i++) { |
|
195 | + for ($i=0; $i<$count; $i++) { |
|
196 | 196 | $this->getCell($i, $colIndex)->setValue($values[$i]); |
197 | 197 | } |
198 | 198 | return $this; |
@@ -200,20 +200,20 @@ discard block |
||
200 | 200 | |
201 | 201 | public function addColVariations($colIndex, $variations=array()) { |
202 | 202 | $count=$this->count(); |
203 | - for($i=0; $i < $count; $i++) { |
|
203 | + for ($i=0; $i<$count; $i++) { |
|
204 | 204 | $cell=$this->getCell($i, $colIndex); |
205 | - if($cell instanceof BaseTrait) |
|
205 | + if ($cell instanceof BaseTrait) |
|
206 | 206 | $cell->addVariations($variations); |
207 | 207 | } |
208 | 208 | return $this; |
209 | 209 | } |
210 | 210 | |
211 | - public function addPropertyCol($colIndex, $name,$value) { |
|
211 | + public function addPropertyCol($colIndex, $name, $value) { |
|
212 | 212 | $count=$this->count(); |
213 | - for($i=0; $i < $count; $i++) { |
|
213 | + for ($i=0; $i<$count; $i++) { |
|
214 | 214 | $cell=$this->getCell($i, $colIndex); |
215 | - if(isset($cell)) |
|
216 | - $cell->addToProperty($name,$value); |
|
215 | + if (isset($cell)) |
|
216 | + $cell->addToProperty($name, $value); |
|
217 | 217 | } |
218 | 218 | return $this; |
219 | 219 | } |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | |
230 | 230 | private function colAlign($colIndex, $function) { |
231 | 231 | $count=$this->count(); |
232 | - for($i=0; $i < $count; $i++) { |
|
232 | + for ($i=0; $i<$count; $i++) { |
|
233 | 233 | $index=$this->content[$i]->getColPosition($colIndex); |
234 | - if ($index !== NULL) |
|
234 | + if ($index!==NULL) |
|
235 | 235 | $this->getCell($i, $index)->$function(); |
236 | 236 | } |
237 | 237 | return $this; |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | |
240 | 240 | private function colAlignFromRight($colIndex, $function) { |
241 | 241 | $count=$this->count(); |
242 | - for($i=0; $i < $count; $i++) { |
|
242 | + for ($i=0; $i<$count; $i++) { |
|
243 | 243 | $maxRow=$this->content[$i]->count(); |
244 | 244 | $index=$maxRow-$colIndex-1; |
245 | - if (($cell=$this->getCell($i, $index))!== NULL){ |
|
246 | - if($cell->getColspan()==1) |
|
245 | + if (($cell=$this->getCell($i, $index))!==NULL) { |
|
246 | + if ($cell->getColspan()==1) |
|
247 | 247 | $cell->$function(); |
248 | 248 | } |
249 | 249 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | public function getColCount() { |
290 | 290 | $result=0; |
291 | - if ($this->count() > 0) |
|
291 | + if ($this->count()>0) |
|
292 | 292 | $result=$this->getItem(0)->count(); |
293 | 293 | return $result; |
294 | 294 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | public function delete($rowIndex, $colIndex=NULL) { |
303 | 303 | if (isset($colIndex)) { |
304 | 304 | $row=$this->getItem($rowIndex); |
305 | - if (isset($row) === true) { |
|
305 | + if (isset($row)===true) { |
|
306 | 306 | $row->delete($colIndex); |
307 | 307 | } |
308 | 308 | } else { |
@@ -311,9 +311,9 @@ discard block |
||
311 | 311 | return $this; |
312 | 312 | } |
313 | 313 | |
314 | - public function toDelete($rowIndex, $colIndex){ |
|
314 | + public function toDelete($rowIndex, $colIndex) { |
|
315 | 315 | $row=$this->getItem($rowIndex); |
316 | - if (isset($row) === true) |
|
316 | + if (isset($row)===true) |
|
317 | 317 | $row->toDelete($colIndex); |
318 | 318 | return $this; |
319 | 319 | } |
@@ -342,17 +342,17 @@ discard block |
||
342 | 342 | */ |
343 | 343 | public function conditionalCellFormat($callback, $format) { |
344 | 344 | $rows=$this->content; |
345 | - foreach ( $rows as $row ) { |
|
345 | + foreach ($rows as $row) { |
|
346 | 346 | $row->conditionalCellFormat($callback, $format); |
347 | 347 | } |
348 | 348 | return $this; |
349 | 349 | } |
350 | 350 | |
351 | - public function conditionalColFormat($colIndex,$callback,$format){ |
|
351 | + public function conditionalColFormat($colIndex, $callback, $format) { |
|
352 | 352 | $rows=$this->content; |
353 | - foreach ( $rows as $row ) { |
|
353 | + foreach ($rows as $row) { |
|
354 | 354 | $cell=$row->getItem($colIndex); |
355 | - $cell->conditionnalCellFormat($callback,$format); |
|
355 | + $cell->conditionnalCellFormat($callback, $format); |
|
356 | 356 | } |
357 | 357 | return $this; |
358 | 358 | } |
@@ -364,17 +364,17 @@ discard block |
||
364 | 364 | */ |
365 | 365 | public function conditionalRowFormat($callback, $format) { |
366 | 366 | $rows=$this->content; |
367 | - foreach ( $rows as $row ) { |
|
367 | + foreach ($rows as $row) { |
|
368 | 368 | $row->conditionalRowFormat($callback, $format); |
369 | 369 | } |
370 | 370 | return $this; |
371 | 371 | } |
372 | 372 | |
373 | - public function hideColumn($colIndex){ |
|
373 | + public function hideColumn($colIndex) { |
|
374 | 374 | $rows=$this->content; |
375 | - foreach ( $rows as $row ) { |
|
375 | + foreach ($rows as $row) { |
|
376 | 376 | $cell=$row->getItem($colIndex); |
377 | - $cell->addToProperty("style","display:none;"); |
|
377 | + $cell->addToProperty("style", "display:none;"); |
|
378 | 378 | } |
379 | 379 | return $this; |
380 | 380 | } |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | */ |
386 | 386 | public function applyCells($callback) { |
387 | 387 | $rows=$this->content; |
388 | - foreach ( $rows as $row ) { |
|
388 | + foreach ($rows as $row) { |
|
389 | 389 | $row->applyCells($callback); |
390 | 390 | } |
391 | 391 | return $this; |
@@ -397,25 +397,25 @@ discard block |
||
397 | 397 | */ |
398 | 398 | public function applyRows($callback) { |
399 | 399 | $rows=$this->content; |
400 | - foreach ( $rows as $row ) { |
|
400 | + foreach ($rows as $row) { |
|
401 | 401 | $row->apply($callback); |
402 | 402 | } |
403 | 403 | return $this; |
404 | 404 | } |
405 | 405 | |
406 | - public function mergeIdentiqualValues($colIndex,$function="strip_tags"){ |
|
406 | + public function mergeIdentiqualValues($colIndex, $function="strip_tags") { |
|
407 | 407 | $rows=$this->content; |
408 | 408 | $identiqual=null; |
409 | 409 | $counter=0; |
410 | 410 | $cellToMerge=null; |
411 | 411 | $functionExists=\function_exists($function); |
412 | - foreach ( $rows as $row ) { |
|
412 | + foreach ($rows as $row) { |
|
413 | 413 | $cell=$row->getItem($colIndex); |
414 | 414 | $value=$cell->getContent(); |
415 | - if($functionExists) |
|
416 | - $value=\call_user_func($function,$value); |
|
417 | - if($value!==$identiqual){ |
|
418 | - if($counter>0 && isset($cellToMerge)){ |
|
415 | + if ($functionExists) |
|
416 | + $value=\call_user_func($function, $value); |
|
417 | + if ($value!==$identiqual) { |
|
418 | + if ($counter>0 && isset($cellToMerge)) { |
|
419 | 419 | $cellToMerge->setRowspan($counter); |
420 | 420 | } |
421 | 421 | $counter=0; |
@@ -424,17 +424,17 @@ discard block |
||
424 | 424 | } |
425 | 425 | $counter++; |
426 | 426 | } |
427 | - if($counter>0 && isset($cellToMerge)){ |
|
427 | + if ($counter>0 && isset($cellToMerge)) { |
|
428 | 428 | $cellToMerge->setRowspan($counter); |
429 | 429 | } |
430 | 430 | return $this; |
431 | 431 | } |
432 | 432 | |
433 | - public function _isMerged(){ |
|
433 | + public function _isMerged() { |
|
434 | 434 | return $this->_merged; |
435 | 435 | } |
436 | 436 | |
437 | - public function _setMerged($value){ |
|
437 | + public function _setMerged($value) { |
|
438 | 438 | $this->_merged=$value; |
439 | 439 | return $this; |
440 | 440 | } |