Replace CRM_Utils_Array::value with ?? in variable assignments
[civicrm-core.git] / CRM / Report / Form / Case / Demographics.php
index 8115604f02099d93698003490c947d149fb72436..6c9f105f859634a7ceeda9d6157dde91f304cbca 100644 (file)
@@ -250,7 +250,7 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu
             }
 
             $select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
-            $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+            $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
             $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'];
           }
         }
@@ -308,18 +308,18 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu
         foreach ($table['filters'] as $fieldName => $field) {
           $clause = NULL;
           if ($field['operatorType'] & CRM_Report_Form::OP_DATE) {
-            $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params);
-            $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
-            $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
+            $relative = $this->_params["{$fieldName}_relative"] ?? NULL;
+            $from = $this->_params["{$fieldName}_from"] ?? NULL;
+            $to = $this->_params["{$fieldName}_to"] ?? NULL;
 
             $clause = $this->dateClause($field['dbAlias'], $relative, $from, $to, CRM_Utils_Type::T_DATE);
           }
           else {
-            $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+            $op = $this->_params["{$fieldName}_op"] ?? NULL;
             if ($op) {
               // handle special case
               if ($fieldName == 'case_id_filter') {
-                $choice = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
+                $choice = $this->_params["{$fieldName}_value"] ?? NULL;
                 if ($choice == 1) {
                   $clause = "({$this->_aliases['civicrm_case']}.id Is Not Null)";
                 }