Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michal Kleiner <[email protected]>
  • Loading branch information
sgiehl and michalkleiner committed Jan 17, 2025
1 parent 43c6436 commit 2514ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/DataTable/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,13 @@ protected function getColumnAggregationOperation($columnNameOrId, $aggregationOp
if (isset($aggregationOperations[$columnNameOrId])) {
$operationName = $aggregationOperations[$columnNameOrId];
} elseif (is_numeric($columnNameOrId)) {
// if the column was provided as index, check if a aggration is set for the real name
// if the column was provided as index, check if an aggregation is set for the real name
$metricsIdToName = Metrics::getMappingFromIdToName();
if (isset($metricsIdToName[$columnNameOrId]) && isset($aggregationOperations[$metricsIdToName[$columnNameOrId]])) {
$operationName = $aggregationOperations[$metricsIdToName[$columnNameOrId]];
}
} else {
// if the column was provided as string, check if a aggration is set for the index
// if the column was provided as string, check if an aggregation is set for the index
$metricsNameToId = Metrics::getMappingFromNameToId();
if (isset($metricsNameToId[$columnNameOrId]) && isset($aggregationOperations[$metricsNameToId[$columnNameOrId]])) {
$operationName = $aggregationOperations[$metricsNameToId[$columnNameOrId]];
Expand Down
4 changes: 2 additions & 2 deletions plugins/API/ProcessedReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ private function handleSimpleDataTable($idSite, $simpleDataTable, $metadataColum
);
}

private function aggregateReportTotalValues($simpleDataTable, $metadateColumns, $totals)
private function aggregateReportTotalValues($simpleDataTable, $metadataColumns, $totals)
{
$metadataTotals = $simpleDataTable->getMetadata('totalsUnformatted');

Expand All @@ -790,7 +790,7 @@ private function aggregateReportTotalValues($simpleDataTable, $metadateColumns,
// remove columns from totals row that are not in metadata
foreach ($metadataTotals as $metadataCol => $metadataValue) {
if (
isset($metadateColumns[$metadataCol])
isset($metadataColumns[$metadataCol])
|| preg_match('/^goal_[0-9]+_/', $metadataCol)
) {
$simpleTotals[$metadataCol] = $metadataValue;
Expand Down

0 comments on commit 2514ea5

Please sign in to comment.