diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-30 09:37:32 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-30 09:37:32 +0400 |
commit | a00487b0b841c4b15463b591c7f62176c4b84d15 (patch) | |
tree | 6eb893ce356a4740e044c9cdadaf84ffb2095b9d /core/DataTable.php | |
parent | 0edef3332289a7cbe54b58084b967907d1086d29 (diff) |
coding style fixes, some PHPStorm inspection fixes, improved readability of code, few refactorings, all as part of our code cleanup strategy
Diffstat (limited to 'core/DataTable.php')
-rw-r--r-- | core/DataTable.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/DataTable.php b/core/DataTable.php index bc5a57cff6..4d308f7d21 100644 --- a/core/DataTable.php +++ b/core/DataTable.php @@ -469,11 +469,13 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess * metadata can be used to specify a different type of operation. * * @param \Piwik\DataTable $tableToSum + * @param bool $doAggregateSubTables + * @throws Exception */ public function addDataTable(DataTable $tableToSum, $doAggregateSubTables = true) { - if($tableToSum instanceof Simple) { - if($tableToSum->getRowsCount() > 1) { + if ($tableToSum instanceof Simple) { + if ($tableToSum->getRowsCount() > 1) { throw new Exception("Did not expect a Simple table with more than one row in addDataTable()"); } $row = $tableToSum->getFirstRow(); @@ -897,7 +899,7 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess foreach ($this->getRows() as $row) { $row->renameColumn($oldName, $newName); - if($doRenameColumnsOfSubTables) { + if ($doRenameColumnsOfSubTables) { if (($idSubDataTable = $row->getIdSubDataTable()) !== null) { Manager::getInstance()->getTable($idSubDataTable)->renameColumn($oldName, $newName); } @@ -1602,7 +1604,7 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess } else { $rowFound->sumRow($row, $copyMeta = true, $this->getMetadata(self::COLUMN_AGGREGATION_OPS_METADATA_NAME)); - if($doAggregateSubTables) { + if ($doAggregateSubTables) { // if the row to add has a subtable whereas the current row doesn't // we simply add it (cloning the subtable) // if the row has the subtable already |