Skip to content

Commit

Permalink
A couple more code-std fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Aug 14, 2022
1 parent 3216b70 commit b24258b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions CRM/Extendedreport/Form/Report/ExtendedReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ public function alterDisplay(&$rows): void {

if (isset($this->_params['delete_null']) && $this->_params['delete_null'] == '1') {
foreach ($this->rollupRow as $rowName => $rowValue) {
if ($rowValue != '' && is_numeric($rowValue) && $rowValue == 0) {
if ($rowValue !== '' && is_numeric($rowValue) && $rowValue == 0) {
unset ($this->_columnHeaders[$rowName]);
}
}
Expand Down Expand Up @@ -2331,7 +2331,7 @@ public function alterDisplay(&$rows): void {
// Add any alters that can be intuited from the field specs.
// So far only boolean but a lot more could be.
if (empty($alterSpecs[$fieldAlias])
&& $specs['type'] == CRM_Utils_Type::T_BOOLEAN
&& $specs['type'] === CRM_Utils_Type::T_BOOLEAN
// Do not handle custom fields in alter functions
// as they are otherwise handled.
&& empty($specs['extends'])) {
Expand Down Expand Up @@ -2488,7 +2488,7 @@ public function sectionTotals(): void {
}
}
foreach ($totalsArray as $fieldKey => $value) {
foreach ($value as $statKey => $spec) {
foreach ($value as $spec) {
$totals[$fieldKey][] = $spec['title'] . ' : ' . $spec['value'];
}
$totals[$fieldKey] = implode(' , ', $totals[$fieldKey]);
Expand Down Expand Up @@ -2552,7 +2552,7 @@ protected function alterRollupRows(array &$rows): void {
$statLayers = count($this->_groupByArray);

//I don't know that this precaution is required? $this->fixSubTotalDisplay($rows[$rowNum], $this->_statFields);
if (count($this->_statFields) == 0) {
if (count($this->_statFields) === 0) {
return;
}

Expand Down Expand Up @@ -2608,7 +2608,7 @@ public function alterCustomDataDisplay(&$rows): void {
return;
}
$extends = $this->_customGroupExtends;
foreach ($this->_customGroupExtended as $table => $spec) {
foreach ($this->_customGroupExtended as $spec) {
$extends = array_merge($extends, $spec['extends']);
}

Expand Down Expand Up @@ -7559,8 +7559,9 @@ protected function getSelectedHavings(): array {
$havings = $this->getMetadataByType('having');
$selectedHavings = [];
foreach ($havings as $field => $spec) {
if (isset($this->_params[$field . '_value']) && (
$this->_params[$field . '_value'] === 0 || !empty($this->_params[$field . '_value'])
$fieldValue = $field . '_value';
if (isset($this->_params[$fieldValue]) && (
$this->_params[$fieldValue] === 0 || !empty($this->_params[$fieldValue])
)) {
$selectedHavings[$field] = $spec;
}
Expand Down

0 comments on commit b24258b

Please sign in to comment.