diff options
author | fabiocarneiro <fahecs@gmail.com> | 2015-05-27 12:56:17 +0300 |
---|---|---|
committer | fabiocarneiro <fahecs@gmail.com> | 2015-05-27 12:56:17 +0300 |
commit | a2a63d34ebb460174e1a3e8d8022fe3e3ab4b469 (patch) | |
tree | fbfc480352bc711bc03f12849824507e56b5034a /core/DataTable.php | |
parent | b2f5b5489ceca056217fc6663ec6c2c6b052cd42 (diff) |
fix core folder with php-cs-fixer for psr-2
Diffstat (limited to 'core/DataTable.php')
-rw-r--r-- | core/DataTable.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/core/DataTable.php b/core/DataTable.php index 884100b53a..f55bc42a1a 100644 --- a/core/DataTable.php +++ b/core/DataTable.php @@ -392,7 +392,6 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess if ($this->isSortRecursiveEnabled()) { foreach ($this->getRowsWithoutSummaryRow() as $row) { - $subTable = $row->getSubtable(); if ($subTable) { $subTable->enableRecursiveSort(); @@ -772,8 +771,9 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess if ($this->maximumAllowedRows > 0 && $this->getRowsCount() >= $this->maximumAllowedRows - 1 ) { - if ($this->summaryRow === null) // create the summary row if necessary - { + if ($this->summaryRow === null) { + // create the summary row if necessary + $columns = array('label' => self::LABEL_SUMMARY_ROW) + $row->getColumns(); $this->addSummaryRow(new Row(array(Row::COLUMNS => $columns))); } else { @@ -1657,15 +1657,17 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess // if there is no table to advance to, and we're not adding missing rows, return false if ($missingRowColumns === false) { return array(false, $i); - } else // if we're adding missing rows, add a new row - { + } else { + // if we're adding missing rows, add a new row + $row = new DataTableSummaryRow(); $row->setColumns(array('label' => $segment) + $missingRowColumns); $next = $table->addRow($row); - if ($next !== $row) // if the row wasn't added, the table is full - { + if ($next !== $row) { + // if the row wasn't added, the table is full + // Summary row, has no metadata $next->deleteMetadata(); return array($next, $i); @@ -1679,8 +1681,9 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess // missing rows, return false if ($missingRowColumns === false) { return array(false, $i); - } else if ($i != $pathLength - 1) // create subtable if missing, but only if not on the last segment - { + } elseif ($i != $pathLength - 1) { + // create subtable if missing, but only if not on the last segment + $table = new DataTable(); $table->setMaximumAllowedRows($maxSubtableRows); $table->metadata[self::COLUMN_AGGREGATION_OPS_METADATA_NAME] @@ -1829,7 +1832,6 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess { if ($row === false) { return; - } $thisRow = $this->getFirstRow(); if ($thisRow === false) { @@ -1850,7 +1852,8 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess /** * @return \ArrayIterator|Row[] */ - public function getIterator() { + public function getIterator() + { return new \ArrayIterator($this->getRows()); } |