";
diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php
index d560d734f9eb..5c3bf571e862 100644
--- a/CRM/Core/Permission.php
+++ b/CRM/Core/Permission.php
@@ -465,7 +465,7 @@ public static function checkActionPermission($module, $action) {
'CiviMail' => 'access CiviMail',
'CiviAuction' => 'add auction items',
];
- $permissionName = CRM_Utils_Array::value($module, $editPermissions);
+ $permissionName = $editPermissions[$module] ?? NULL;
}
if ($module == 'CiviCase' && !$permissionName) {
diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php
index 773194a1aea1..c179a8a4a957 100644
--- a/CRM/Core/PseudoConstant.php
+++ b/CRM/Core/PseudoConstant.php
@@ -824,7 +824,7 @@ public static function country($id = FALSE, $applyLimit = TRUE) {
$countryIsoCodes = self::countryIsoCode();
$defaultID = array_search(CRM_Core_BAO_Country::defaultContactCountry(), $countryIsoCodes);
if ($defaultID !== FALSE) {
- $default[$defaultID] = CRM_Utils_Array::value($defaultID, self::$country);
+ $default[$defaultID] = self::$country[$defaultID] ?? NULL;
self::$country = $default + self::$country;
}
}
@@ -1393,7 +1393,7 @@ public static function greeting($filter, $columnName = 'label') {
$index = $filter['greeting_type'] . '_' . $columnName;
// also add contactType to the array
- $contactType = CRM_Utils_Array::value('contact_type', $filter);
+ $contactType = $filter['contact_type'] ?? NULL;
if ($contactType) {
$index .= '_' . $contactType;
}
diff --git a/CRM/Core/Smarty/plugins/function.crmAPI.php b/CRM/Core/Smarty/plugins/function.crmAPI.php
index 57c8efe178be..c1eae333e22a 100644
--- a/CRM/Core/Smarty/plugins/function.crmAPI.php
+++ b/CRM/Core/Smarty/plugins/function.crmAPI.php
@@ -31,7 +31,7 @@ function smarty_function_crmAPI($params, &$smarty) {
$entity = $params['entity'];
$action = CRM_Utils_Array::value('action', $params, 'get');
$params['sequential'] = CRM_Utils_Array::value('sequential', $params, 1);
- $var = CRM_Utils_Array::value('var', $params);
+ $var = $params['var'] ?? NULL;
CRM_Utils_Array::remove($params, 'entity', 'action', 'var');
$params['version'] = 3;
require_once 'api/api.php';
diff --git a/CRM/Custom/Form/DeleteField.php b/CRM/Custom/Form/DeleteField.php
index 492a5847a13e..8298ec966065 100644
--- a/CRM/Custom/Form/DeleteField.php
+++ b/CRM/Custom/Form/DeleteField.php
@@ -49,7 +49,7 @@ public function preProcess() {
$params = ['id' => $this->_id];
CRM_Core_BAO_CustomField::retrieve($params, $defaults);
- $this->_title = CRM_Utils_Array::value('label', $defaults);
+ $this->_title = $defaults['label'] ?? NULL;
$this->assign('title', $this->_title);
CRM_Utils_System::setTitle(ts('Delete %1', [1 => $this->_title]));
}
diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php
index 0aeb046607e3..3881c1d98085 100644
--- a/CRM/Custom/Form/Field.php
+++ b/CRM/Custom/Form/Field.php
@@ -90,7 +90,7 @@ public function preProcess() {
$params = ['id' => $this->_id];
CRM_Core_BAO_CustomField::retrieve($params, $this->_values);
// note_length is an alias for the text_length field
- $this->_values['note_length'] = CRM_Utils_Array::value('text_length', $this->_values);
+ $this->_values['note_length'] = $this->_values['text_length'] ?? NULL;
// custom group id
$this->_gid = $this->_values['custom_group_id'];
}
@@ -571,7 +571,7 @@ public function buildQuickForm() {
* true otherwise
*/
public static function formRule($fields, $files, $self) {
- $default = CRM_Utils_Array::value('default_value', $fields);
+ $default = $fields['default_value'] ?? NULL;
$errors = [];
diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php
index e21c34fe5ae3..10c582c32053 100644
--- a/CRM/Custom/Form/Group.php
+++ b/CRM/Custom/Form/Group.php
@@ -73,7 +73,7 @@ public function preProcess() {
$params = ['id' => $this->_id];
CRM_Core_BAO_CustomGroup::retrieve($params, $this->_defaults);
- $subExtends = CRM_Utils_Array::value('extends_entity_column_value', $this->_defaults);
+ $subExtends = $this->_defaults['extends_entity_column_value'] ?? NULL;
if (!empty($subExtends)) {
$this->_subtypes = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($subExtends, 1, -1));
}
@@ -255,7 +255,7 @@ public function buildQuickForm() {
$sel->_elements[1]->setSize(5);
}
if ($this->_action == CRM_Core_Action::UPDATE) {
- $subName = CRM_Utils_Array::value('extends_entity_column_id', $this->_defaults);
+ $subName = $this->_defaults['extends_entity_column_id'] ?? NULL;
if ($this->_defaults['extends'] == 'Participant') {
if ($subName == 1) {
$this->_defaults['extends'] = 'ParticipantRole';
diff --git a/CRM/Custom/Import/Form/MapField.php b/CRM/Custom/Import/Form/MapField.php
index b7a42335c242..30db99f01f13 100644
--- a/CRM/Custom/Import/Form/MapField.php
+++ b/CRM/Custom/Import/Form/MapField.php
@@ -83,7 +83,7 @@ public static function formRule($fields) {
}
if (!empty($fields['saveMapping'])) {
- $nameField = CRM_Utils_Array::value('saveMappingName', $fields);
+ $nameField = $fields['saveMappingName'] ?? NULL;
if (empty($nameField)) {
$errors['saveMappingName'] = ts('Name is required to save Import Mapping');
}
@@ -96,7 +96,7 @@ public static function formRule($fields) {
//display Error if loaded mapping is not selected
if (array_key_exists('loadMapping', $fields)) {
- $getMapName = CRM_Utils_Array::value('savedMapping', $fields);
+ $getMapName = $fields['savedMapping'] ?? NULL;
if (empty($getMapName)) {
$errors['savedMapping'] = ts('Select saved mapping');
}
@@ -172,9 +172,9 @@ public function postProcess() {
$updateMappingFields->column_number = $i;
$explodedValues = explode('_', $mapperKeys[$i][0]);
- $id = CRM_Utils_Array::value(0, $explodedValues);
- $first = CRM_Utils_Array::value(1, $explodedValues);
- $second = CRM_Utils_Array::value(2, $explodedValues);
+ $id = $explodedValues[0] ?? NULL;
+ $first = $explodedValues[1] ?? NULL;
+ $second = $explodedValues[2] ?? NULL;
$updateMappingFields->name = $mapper[$i];
$updateMappingFields->save();
@@ -196,9 +196,9 @@ public function postProcess() {
$saveMappingFields->column_number = $i;
$explodedValues = explode('_', $mapperKeys[$i][0]);
- $id = CRM_Utils_Array::value(0, $explodedValues);
- $first = CRM_Utils_Array::value(1, $explodedValues);
- $second = CRM_Utils_Array::value(2, $explodedValues);
+ $id = $explodedValues[0] ?? NULL;
+ $first = $explodedValues[1] ?? NULL;
+ $second = $explodedValues[2] ?? NULL;
$saveMappingFields->name = $mapper[$i];
$saveMappingFields->save();
diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php
index da2eb78f098b..db3180adb737 100644
--- a/CRM/Custom/Import/Parser/Api.php
+++ b/CRM/Custom/Import/Parser/Api.php
@@ -242,7 +242,7 @@ public function getGroupFieldsForImport($id) {
$allFields = civicrm_api3('custom_field', 'get', $params);
$fields = $allFields['values'];
foreach ($fields as $id => $values) {
- $datatype = CRM_Utils_Array::value('data_type', $values);
+ $datatype = $values['data_type'] ?? NULL;
if ($datatype == 'File') {
continue;
}
@@ -261,8 +261,8 @@ public function getGroupFieldsForImport($id) {
'is_search_range' => $values['is_search_range'] ?? NULL,
];
if (CRM_Utils_Array::value('html_type', $values) == 'Select Date') {
- $importableFields[$key]['date_format'] = CRM_Utils_Array::value('date_format', $values);
- $importableFields[$key]['time_format'] = CRM_Utils_Array::value('time_format', $values);
+ $importableFields[$key]['date_format'] = $values['date_format'] ?? NULL;
+ $importableFields[$key]['time_format'] = $values['time_format'] ?? NULL;
$this->_dateFields[] = $key;
}
}
diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php
index e0bb74ac159c..76fa828ea7a6 100644
--- a/CRM/Custom/Page/Group.php
+++ b/CRM/Custom/Page/Group.php
@@ -268,9 +268,9 @@ public function browse($action = NULL) {
CRM_Core_BAO_CustomGroup::getExtendedObjectTypes($subTypes);
foreach ($customGroup as $key => $values) {
- $subValue = CRM_Utils_Array::value('extends_entity_column_value', $customGroup[$key]);
- $subName = CRM_Utils_Array::value('extends_entity_column_id', $customGroup[$key]);
- $type = CRM_Utils_Array::value('extends', $customGroup[$key]);
+ $subValue = $customGroup[$key]['extends_entity_column_value'] ?? NULL;
+ $subName = $customGroup[$key]['extends_entity_column_id'] ?? NULL;
+ $type = $customGroup[$key]['extends'] ?? NULL;
if ($subValue) {
$subValue = explode(CRM_Core_DAO::VALUE_SEPARATOR,
substr($subValue, 1, -1)
diff --git a/CRM/Dedupe/BAO/Exception.php b/CRM/Dedupe/BAO/Exception.php
index 3c4c783cfcd7..6097887055a5 100644
--- a/CRM/Dedupe/BAO/Exception.php
+++ b/CRM/Dedupe/BAO/Exception.php
@@ -30,13 +30,13 @@ class CRM_Dedupe_BAO_Exception extends CRM_Dedupe_DAO_Exception {
public static function create($params) {
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, 'Exception', CRM_Utils_Array::value('id', $params), $params);
- $contact1 = CRM_Utils_Array::value('contact_id1', $params);
- $contact2 = CRM_Utils_Array::value('contact_id2', $params);
+ $contact1 = $params['contact_id1'] ?? NULL;
+ $contact2 = $params['contact_id2'] ?? NULL;
$dao = new CRM_Dedupe_BAO_Exception();
$dao->copyValues($params);
if ($contact1 && $contact2) {
CRM_Core_DAO::singleValueQuery("
- DELETE FROM civicrm_prevnext_cache
+ DELETE FROM civicrm_prevnext_cache
WHERE (entity_id1 = %1 AND entity_id2 = %2)
OR (entity_id1 = %2 AND entity_id2 = %2)",
[1 => [$contact1, 'Integer'], 2 => [$contact2, 'Integer']]
diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
index 373866f7a868..4a4b93d618d4 100644
--- a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
+++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
@@ -12,8 +12,8 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_Query
* @return array
*/
public static function record($rg) {
- $civicrm_contact = CRM_Utils_Array::value('civicrm_contact', $rg->params);
- $civicrm_address = CRM_Utils_Array::value('civicrm_address', $rg->params);
+ $civicrm_contact = $rg->params['civicrm_contact'] ?? NULL;
+ $civicrm_address = $rg->params['civicrm_address'] ?? NULL;
// Since definitely have first and last name, escape them upfront.
$first_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('first_name', $civicrm_contact, ''));
diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php
index 06863a2afabd..97e8abcf51bc 100644
--- a/CRM/Dedupe/Finder.php
+++ b/CRM/Dedupe/Finder.php
@@ -230,7 +230,7 @@ public static function formatParams($fields, $ctype) {
continue;
}
foreach ($cg['fields'] as $cf) {
- $flat[$cf['column_name']] = CRM_Utils_Array::value('data', $cf['customValue']);
+ $flat[$cf['column_name']] = $cf['customValue']['data'] ?? NULL;
}
}
diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php
index 6c1d7d6bfd21..d5d1c5a132d4 100644
--- a/CRM/Dedupe/Merger.php
+++ b/CRM/Dedupe/Merger.php
@@ -637,8 +637,8 @@ public static function retrieveFields($main, $other) {
if (strpos($key, '_')) {
continue;
}
- $key1 = CRM_Utils_Array::value($key, $mainEvs);
- $key2 = CRM_Utils_Array::value($key, $otherEvs);
+ $key1 = $mainEvs[$key] ?? NULL;
+ $key2 = $otherEvs[$key] ?? NULL;
// We wish to retain '0' as it has a different meaning than NULL on a checkbox.
// However I can't think of a case where an empty string is more meaningful than null
// or where it would be FALSE or something else nullish.
@@ -859,7 +859,7 @@ public static function getMergeStatsMsg($stats) {
public static function merge($dupePairs = [], $cacheParams = [], $mode = 'safe',
$redirectForPerformance = FALSE, $checkPermissions = TRUE
) {
- $cacheKeyString = CRM_Utils_Array::value('cache_key_string', $cacheParams);
+ $cacheKeyString = $cacheParams['cache_key_string'] ?? NULL;
$resultStats = ['merged' => [], 'skipped' => []];
// we don't want dupe caching to get reset after every-merge, and therefore set the
@@ -1716,7 +1716,7 @@ public static function mergeLocations($mainId, $otherId, $migrationInfo) {
// @todo Tidy this up
$operation = 0;
if ($fieldName != 'website') {
- $operation = CRM_Utils_Array::value('operation', $migrationInfo['location_blocks'][$fieldName][$fieldCount]);
+ $operation = $migrationInfo['location_blocks'][$fieldName][$fieldCount]['operation'] ?? NULL;
}
// default operation is overwrite.
if (!$operation) {
@@ -1744,7 +1744,7 @@ public static function mergeLocations($mainId, $otherId, $migrationInfo) {
$billingDAOId = (array_key_exists($name, $billingBlockIds)) ? array_pop($billingBlockIds[$name]) : NULL;
foreach ($block as $blkCount => $values) {
- $otherBlockId = CRM_Utils_Array::value('id', $migrationInfo['other_details']['location_blocks'][$name][$blkCount]);
+ $otherBlockId = $migrationInfo['other_details']['location_blocks'][$name][$blkCount]['id'] ?? NULL;
$mainBlockId = CRM_Utils_Array::value('mainContactBlockId', $migrationInfo['location_blocks'][$name][$blkCount], 0);
if (!$otherBlockId) {
continue;
@@ -1759,18 +1759,18 @@ public static function mergeLocations($mainId, $otherId, $migrationInfo) {
// Add/update location and type information from the form, if applicable
if ($locationBlocks[$name]['hasLocation']) {
- $locTypeId = CRM_Utils_Array::value('locTypeId', $migrationInfo['location_blocks'][$name][$blkCount]);
+ $locTypeId = $migrationInfo['location_blocks'][$name][$blkCount]['locTypeId'] ?? NULL;
$otherBlockDAO->location_type_id = $locTypeId;
}
if ($locationBlocks[$name]['hasType']) {
- $typeTypeId = CRM_Utils_Array::value('typeTypeId', $migrationInfo['location_blocks'][$name][$blkCount]);
+ $typeTypeId = $migrationInfo['location_blocks'][$name][$blkCount]['typeTypeId'] ?? NULL;
$otherBlockDAO->{$locationBlocks[$name]['hasType']} = $typeTypeId;
}
// If we're deliberately setting this as primary then add the flag
// and remove it from the current primary location (if there is one).
// But only once for each entity.
- $set_primary = CRM_Utils_Array::value('set_other_primary', $migrationInfo['location_blocks'][$name][$blkCount]);
+ $set_primary = $migrationInfo['location_blocks'][$name][$blkCount]['set_other_primary'] ?? NULL;
if (!$changePrimary && $set_primary == "1") {
$otherBlockDAO->is_primary = 1;
if ($primaryDAOId) {
@@ -2125,7 +2125,7 @@ public static function getConflicts(&$migrationInfo, $mainId, $otherId, $mode) {
// Load the address we're inspecting from the 'other' contact
$addressRecord = $migrationInfo['other_details']['location_blocks'][$fieldName][$fieldCount];
- $addressRecordLocTypeId = CRM_Utils_Array::value('location_type_id', $addressRecord);
+ $addressRecordLocTypeId = $addressRecord['location_type_id'] ?? NULL;
// If it exists on the 'main' contact already, skip it. Otherwise
// if the location type exists already, log a conflict.
@@ -2217,7 +2217,7 @@ protected static function formatConflictArray($conflicts, $migrationInfo, $toKee
if (in_array($fieldName, self::ignoredFields())) {
continue;
}
- $toRemoveValue = CRM_Utils_Array::value($fieldName, $toRemoveContactLocationBlocks[$entity][$blockIndex]);
+ $toRemoveValue = $toRemoveContactLocationBlocks[$entity][$blockIndex][$fieldName] ?? NULL;
if ($fieldValue !== $toRemoveValue) {
$entityConflicts[$fieldName] = [
$toKeepID => $fieldValue,
@@ -2296,7 +2296,7 @@ protected static function ignoredFields(): array {
*/
private static function getFieldValueAndLabel($field, $contact): array {
$fields = self::getMergeFieldsMetadata();
- $value = $label = CRM_Utils_Array::value($field, $contact);
+ $value = $label = $contact[$field] ?? NULL;
$fieldSpec = $fields[$field];
if (!empty($fieldSpec['serialize']) && is_array($value)) {
// In practice this only applies to preferred_communication_method as the sub types are skipped above
@@ -2475,7 +2475,7 @@ protected static function addLocationFieldInfo($mainId, $otherId, $blockInfo, $b
$lookupType = FALSE;
if ($blockInfo['hasType']) {
- $lookupType = CRM_Utils_Array::value($blockInfo['hasType'], $value);
+ $lookupType = $value[$blockInfo['hasType']] ?? NULL;
}
// Hold ID of main contact's matching block
@@ -2571,7 +2571,7 @@ protected static function addLocationFieldInfo($mainId, $otherId, $blockInfo, $b
// Load the type options for this entity
$typeOptions = civicrm_api3($blockName, 'getoptions', ['field' => $blockInfo['hasType']]);
- $thisTypeId = CRM_Utils_Array::value($blockInfo['hasType'], $value);
+ $thisTypeId = $value[$blockInfo['hasType']] ?? NULL;
// Put this field's location type at the top of the list
$tmpIdList = $typeOptions['values'];
diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php
index 29252fc27ef9..1e178acae2a7 100644
--- a/CRM/Event/BAO/Event.php
+++ b/CRM/Event/BAO/Event.php
@@ -134,7 +134,7 @@ public static function create(&$params) {
$contactId = CRM_Core_Session::getLoggedInContactID();
if (!$contactId) {
- $contactId = CRM_Utils_Array::value('contact_id', $params);
+ $contactId = $params['contact_id'] ?? NULL;
}
// Log the information on successful add/edit of Event
@@ -1104,8 +1104,8 @@ public static function sendMail($contactID, $values, $participantId, $isTest = F
//send email only when email is present
if (isset($email) || $returnMessageText) {
- $preProfileID = CRM_Utils_Array::value('custom_pre_id', $values);
- $postProfileID = CRM_Utils_Array::value('custom_post_id', $values);
+ $preProfileID = $values['custom_pre_id'] ?? NULL;
+ $postProfileID = $values['custom_post_id'] ?? NULL;
if (!empty($values['params']['additionalParticipant'])) {
$preProfileID = CRM_Utils_Array::value('additional_custom_pre_id', $values, $preProfileID);
@@ -1233,7 +1233,7 @@ public static function sendMail($contactID, $values, $participantId, $isTest = F
);
// append invoice pdf to email
$prefixValue = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
+ $invoicing = $prefixValue['invoicing'] ?? NULL;
if (isset($invoicing) && isset($prefixValue['is_email_pdf']) && !empty($values['contributionId'])) {
$sendTemplateParams['isEmailPdf'] = TRUE;
$sendTemplateParams['contributionId'] = $values['contributionId'];
@@ -1581,7 +1581,7 @@ public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$
}
elseif (substr($name, -11) == 'campaign_id') {
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($params[$name]);
- $values[$index] = CRM_Utils_Array::value($params[$name], $campaigns);
+ $values[$index] = $campaigns[$params[$name]] ?? NULL;
}
elseif (strpos($name, '-') !== FALSE) {
list($fieldName, $id) = CRM_Utils_System::explode('-', $name, 2);
@@ -1598,7 +1598,7 @@ public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$
elseif ($fieldName == 'im') {
$providerName = NULL;
if ($providerId = $detailName . '-provider_id') {
- $providerName = CRM_Utils_Array::value($params[$providerId], $imProviders);
+ $providerName = $imProviders[$params[$providerId]] ?? NULL;
}
if ($providerName) {
$values[$index] = $params[$detailName] . " (" . $providerName . ")";
@@ -1638,8 +1638,8 @@ public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$
$htmlType = $dao->html_type;
if ($htmlType == 'File') {
- $path = CRM_Utils_Array::value('name', $params[$name]);
- $fileType = CRM_Utils_Array::value('type', $params[$name]);
+ $path = $params[$name]['name'] ?? NULL;
+ $fileType = $params[$name]['type'] ?? NULL;
$values[$index] = CRM_Utils_File::getFileURL($path, $fileType);
}
else {
@@ -1710,7 +1710,7 @@ public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$
$values[$index] = CRM_Utils_Date::customFormat(CRM_Utils_Date::format($params[$name]));
}
else {
- $values[$index] = CRM_Utils_Array::value($name, $params);
+ $values[$index] = $params[$name] ?? NULL;
}
}
}
@@ -1780,8 +1780,8 @@ public static function buildCustomProfile(
return $additionalIDs;
}
- $preProfileID = CRM_Utils_Array::value('additional_custom_pre_id', $values);
- $postProfileID = CRM_Utils_Array::value('additional_custom_post_id', $values);
+ $preProfileID = $values['additional_custom_pre_id'] ?? NULL;
+ $postProfileID = $values['additional_custom_post_id'] ?? NULL;
//else build array of Additional participant's information.
if (count($additionalIDs)) {
if ($preProfileID || $postProfileID) {
diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php
index ed598bd5ce86..8117991b406f 100644
--- a/CRM/Event/BAO/Participant.php
+++ b/CRM/Event/BAO/Participant.php
@@ -97,7 +97,7 @@ public static function &add(&$params) {
$participantBAO = new CRM_Event_BAO_Participant();
if (!empty($params['id'])) {
- $participantBAO->id = CRM_Utils_Array::value('id', $params);
+ $participantBAO->id = $params['id'] ?? NULL;
$participantBAO->find(TRUE);
$participantBAO->register_date = CRM_Utils_Date::isoToMysql($participantBAO->register_date);
}
@@ -203,7 +203,7 @@ public static function create(&$params) {
$session = CRM_Core_Session::singleton();
$id = $session->get('userID');
if (!$id) {
- $id = CRM_Utils_Array::value('contact_id', $params);
+ $id = $params['contact_id'] ?? NULL;
}
// add custom field values
@@ -666,7 +666,7 @@ public static function &importableFields($contactType = 'Individual', $status =
'column_name'
);
$value = $customFieldId ? 'custom_' . $customFieldId : $value;
- $tmpContactField[trim($value)] = CRM_Utils_Array::value(trim($value), $contactFields);
+ $tmpContactField[trim($value)] = $contactFields[trim($value)] ?? NULL;
if (!$status) {
$title = $tmpContactField[trim($value)]['title'] . ' (match to contact)';
}
@@ -678,7 +678,7 @@ public static function &importableFields($contactType = 'Individual', $status =
}
}
}
- $extIdentifier = CRM_Utils_Array::value('external_identifier', $contactFields);
+ $extIdentifier = $contactFields['external_identifier'] ?? NULL;
if ($extIdentifier) {
$tmpContactField['external_identifier'] = $extIdentifier;
$tmpContactField['external_identifier']['title'] = CRM_Utils_Array::value('title', $extIdentifier) . ' (match to contact)';
@@ -904,8 +904,8 @@ public static function deleteParticipant($id) {
* @return CRM_Contribute_BAO_Contribution
*/
public static function checkDuplicate($input, &$duplicates) {
- $eventId = CRM_Utils_Array::value('event_id', $input);
- $contactId = CRM_Utils_Array::value('contact_id', $input);
+ $eventId = $input['event_id'] ?? NULL;
+ $contactId = $input['contact_id'] ?? NULL;
$clause = [];
$input = [];
@@ -1283,7 +1283,7 @@ public static function transitionParticipants(
CRM_Event_BAO_Event::retrieve($eventParams, $eventDetails[$eventId]);
//get default participant role.
- $eventDetails[$eventId]['participant_role'] = CRM_Utils_Array::value($eventDetails[$eventId]['default_role_id'], $participantRoles);
+ $eventDetails[$eventId]['participant_role'] = $participantRoles[$eventDetails[$eventId]['default_role_id']] ?? NULL;
//get the location info
$locParams = ['entity_id' => $eventId, 'entity_table' => 'civicrm_event'];
@@ -1296,7 +1296,7 @@ public static function transitionParticipants(
$emailType = NULL;
$toStatus = $statusTypes[$toStatusId];
- $fromStatus = CRM_Utils_Array::value($fromStatusId, $statusTypes);
+ $fromStatus = $statusTypes[$fromStatusId] ?? NULL;
switch ($toStatus) {
case 'Pending from waitlist':
@@ -1432,7 +1432,7 @@ public static function sendTransitionParticipantMail(
) {
return $mailSent;
}
- $toEmail = CRM_Utils_Array::value('email', $contactDetails);
+ $toEmail = $contactDetails['email'] ?? NULL;
if ($toEmail) {
$contactId = $participantValues['contact_id'];
@@ -1442,7 +1442,7 @@ public static function sendTransitionParticipantMail(
$checksumValue = NULL;
if ($mailType == 'Confirm' && !$participantValues['registered_by_id']) {
$checksumLife = 'inf';
- $endDate = CRM_Utils_Array::value('end_date', $eventDetails);
+ $endDate = $eventDetails['end_date'] ?? NULL;
if ($endDate) {
$checksumLife = (CRM_Utils_Date::unixTime($endDate) - time()) / (60 * 60);
}
diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php
index 51be2dfd3e0a..b0166dbff2f1 100644
--- a/CRM/Event/BAO/ParticipantStatusType.php
+++ b/CRM/Event/BAO/ParticipantStatusType.php
@@ -168,7 +168,7 @@ public static function process($params) {
continue;
}
- $expirationTime = CRM_Utils_Array::value('expiration_time', $values);
+ $expirationTime = $values['expiration_time'] ?? NULL;
if ($expirationTime && array_key_exists($values['status_id'], $pendingStatuses)) {
//get the expiration and registration pending time.
diff --git a/CRM/Event/Cart/BAO/MerParticipant.php b/CRM/Event/Cart/BAO/MerParticipant.php
index 0b672a168901..553ab9578b08 100644
--- a/CRM/Event/Cart/BAO/MerParticipant.php
+++ b/CRM/Event/Cart/BAO/MerParticipant.php
@@ -38,7 +38,7 @@ public function __construct($participant = NULL) {
$a = (array) $participant;
$this->copyValues($a);
- $this->email = CRM_Utils_Array::value('email', $participant);
+ $this->email = $participant['email'] ?? NULL;
}
/**
diff --git a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
index 57e28b704550..8f68053a1df0 100644
--- a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
+++ b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
@@ -128,7 +128,7 @@ public function postProcess() {
foreach ($this->events_by_slot as $slot_name => $events) {
$slot_index++;
$field_name = "slot_$slot_index";
- $session_event_id = CRM_Utils_Array::value($field_name, $params, NULL);
+ $session_event_id = $params[$field_name] ?? NULL;
if (!$session_event_id) {
continue;
}
diff --git a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
index c9b2d90ea587..5067ccf33d0a 100644
--- a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
+++ b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
@@ -220,7 +220,7 @@ public function setDefaultValues() {
$price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE, TRUE);
$price_set = $price_sets[$price_set_id];
foreach ($price_set['fields'] as $field) {
- $options = CRM_Utils_Array::value('options', $field);
+ $options = $field['options'] ?? NULL;
if (!is_array($options)) {
continue;
}
diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php
index 96a64ead5633..5f0aa4100cbb 100644
--- a/CRM/Event/Cart/Form/Checkout/Payment.php
+++ b/CRM/Event/Cart/Form/Checkout/Payment.php
@@ -712,7 +712,7 @@ protected function apply_discount($discountCode, &$price_set_amount, &$cost, $ev
$stat = FALSE;
foreach ($discounts as $key => $discountValue) {
if ($key == $discountCode) {
- $events = CRM_Utils_Array::value('events', $discountValue);
+ $events = $discountValue['events'] ?? NULL;
$evt_ids = implode(",", $events);
if ($evt_ids == "0" || strpos($evt_ids, $event_id)) {
$event_match = TRUE;
diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php
index 192e54008e2e..14be8ec5f6e8 100644
--- a/CRM/Event/Form/EventFees.php
+++ b/CRM/Event/Form/EventFees.php
@@ -254,8 +254,8 @@ public static function setDefaultPriceSet($participantID, $eventID = NULL, $incl
$priceFields = $htmlTypes = $optionValues = [];
foreach ($lineItems[$participantID] as $lineId => $items) {
- $priceFieldId = CRM_Utils_Array::value('price_field_id', $items);
- $priceOptionId = CRM_Utils_Array::value('price_field_value_id', $items);
+ $priceFieldId = $items['price_field_id'] ?? NULL;
+ $priceOptionId = $items['price_field_value_id'] ?? NULL;
if ($priceFieldId && $priceOptionId) {
$priceFields[$priceFieldId][] = $priceOptionId;
}
@@ -277,7 +277,7 @@ public static function setDefaultPriceSet($participantID, $eventID = NULL, $incl
foreach ($lineItems[$participantID] as $lineId => $items) {
$fieldId = $items['price_field_id'];
- $htmlType = CRM_Utils_Array::value($fieldId, $htmlTypes);
+ $htmlType = $htmlTypes[$fieldId] ?? NULL;
if (!$htmlType) {
continue;
}
@@ -286,7 +286,7 @@ public static function setDefaultPriceSet($participantID, $eventID = NULL, $incl
$defaults["price_{$fieldId}"] = $items['qty'];
}
else {
- $fieldOptValues = CRM_Utils_Array::value($fieldId, $priceFields);
+ $fieldOptValues = $priceFields[$fieldId] ?? NULL;
if (!is_array($fieldOptValues)) {
continue;
}
diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php
index 19d2c816a16b..6b027289aa03 100644
--- a/CRM/Event/Form/ManageEvent.php
+++ b/CRM/Event/Form/ManageEvent.php
@@ -130,7 +130,7 @@ public function preProcess() {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
- $participantListingID = CRM_Utils_Array::value('participant_listing_id', $eventInfo);
+ $participantListingID = $eventInfo['participant_listing_id'] ?? NULL;
//CRM_Core_DAO::getFieldValue( 'CRM_Event_DAO_Event', $this->_id, 'participant_listing_id' );
if ($participantListingID) {
$participantListingURL = CRM_Utils_System::url('civicrm/event/participant',
@@ -147,7 +147,7 @@ public function preProcess() {
// figure out whether we’re handling an event or an event template
if ($this->_id) {
- $this->_isTemplate = CRM_Utils_Array::value('is_template', $eventInfo);
+ $this->_isTemplate = $eventInfo['is_template'] ?? NULL;
}
elseif ($this->_action & CRM_Core_Action::ADD) {
$this->_isTemplate = CRM_Utils_Request::retrieve('is_template', 'Boolean', $this);
@@ -250,7 +250,7 @@ public function setDefaultValues() {
$params = ['id' => $this->_id];
CRM_Event_BAO_Event::retrieve($params, $defaults);
- $this->_campaignID = CRM_Utils_Array::value('campaign_id', $defaults);
+ $this->_campaignID = $defaults['campaign_id'] ?? NULL;
}
elseif ($this->_templateId) {
$params = ['id' => $this->_templateId];
@@ -275,7 +275,7 @@ public function setDefaultValues() {
public function buildQuickForm() {
$session = CRM_Core_Session::singleton();
- $this->_cancelURL = CRM_Utils_Array::value('cancelURL', $_POST);
+ $this->_cancelURL = $_POST['cancelURL'] ?? NULL;
if (!$this->_cancelURL) {
if ($this->_isTemplate) {
@@ -372,8 +372,8 @@ public function endPostProcess() {
$config = CRM_Core_Config::singleton();
if (in_array('CiviCampaign', $config->enableComponents)) {
$values = $this->controller->exportValues($this->_name);
- $newCampaignID = CRM_Utils_Array::value('campaign_id', $values);
- $eventID = CRM_Utils_Array::value('id', $values);
+ $newCampaignID = $values['campaign_id'] ?? NULL;
+ $eventID = $values['id'] ?? NULL;
if ($eventID && $this->_campaignID != $newCampaignID) {
CRM_Event_BAO_Event::updateParticipantCampaignID($eventID, $newCampaignID);
}
diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php
index c72fc7e27a24..a820295fa163 100644
--- a/CRM/Event/Form/ManageEvent/EventInfo.php
+++ b/CRM/Event/Form/ManageEvent/EventInfo.php
@@ -215,8 +215,8 @@ public function postProcess() {
$params = array_merge($this->controller->exportValues($this->_name), $this->_submitValues);
//format params
- $params['start_date'] = CRM_Utils_Array::value('start_date', $params);
- $params['end_date'] = CRM_Utils_Array::value('end_date', $params);
+ $params['start_date'] = $params['start_date'] ?? NULL;
+ $params['end_date'] = $params['end_date'] ?? NULL;
$params['has_waitlist'] = CRM_Utils_Array::value('has_waitlist', $params, FALSE);
$params['is_map'] = CRM_Utils_Array::value('is_map', $params, FALSE);
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php
index c09d9c91992d..1462a3697c73 100644
--- a/CRM/Event/Form/ManageEvent/Fee.php
+++ b/CRM/Event/Form/ManageEvent/Fee.php
@@ -476,7 +476,7 @@ public static function formRule($values) {
}
}
- $default = CRM_Utils_Array::value('default', $values);
+ $default = $values['default'] ?? NULL;
if ($default && !in_array($default, $optionKeys)) {
$errors['default'] = ts('Please select an appropriate option as default.');
}
@@ -577,9 +577,9 @@ public function postProcess() {
}
else {
// if there are label / values, create custom options for them
- $labels = CRM_Utils_Array::value('label', $params);
- $values = CRM_Utils_Array::value('value', $params);
- $default = CRM_Utils_Array::value('default', $params);
+ $labels = $params['label'] ?? NULL;
+ $values = $params['value'] ?? NULL;
+ $default = $params['default'] ?? NULL;
$options = [];
if (!CRM_Utils_System::isNull($labels) && !CRM_Utils_System::isNull($values)) {
for ($i = 1; $i < self::NUM_OPTION; $i++) {
@@ -624,7 +624,7 @@ public function postProcess() {
unset($params['price_field_value'][$arrayID]);
}
}
- $fieldParams['id'] = CRM_Utils_Array::value('price_field_id', $params);
+ $fieldParams['id'] = $params['price_field_id'] ?? NULL;
$fieldParams['option_id'] = $params['price_field_value'];
$priceSet = new CRM_Price_BAO_PriceSet();
@@ -654,9 +654,9 @@ public function postProcess() {
if (CRM_Utils_Array::value('is_discount', $params) == 1) {
// if there are discounted set of label / values,
// create custom options for them
- $labels = CRM_Utils_Array::value('discounted_label', $params);
- $values = CRM_Utils_Array::value('discounted_value', $params);
- $default = CRM_Utils_Array::value('discounted_default', $params);
+ $labels = $params['discounted_label'] ?? NULL;
+ $values = $params['discounted_value'] ?? NULL;
+ $default = $params['discounted_default'] ?? NULL;
if (!CRM_Utils_System::isNull($labels) && !CRM_Utils_System::isNull($values)) {
for ($j = 1; $j <= self::NUM_DISCOUNT; $j++) {
diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php
index f3244105e58b..9cbf60c8aac1 100644
--- a/CRM/Event/Form/ManageEvent/Registration.php
+++ b/CRM/Event/Form/ManageEvent/Registration.php
@@ -102,7 +102,7 @@ public function setDefaultValues() {
// Set event registration as the default profile if none selected
if (!$defaults['custom_pre_id'] && count($defaults['custom_post']) == 0) {
- $defaults['custom_pre_id'] = CRM_Utils_Array::value('id', $eventRegistrationIdDefaults);
+ $defaults['custom_pre_id'] = $eventRegistrationIdDefaults['id'] ?? NULL;
}
if (isset($defaults['custom_post']) && is_numeric($defaults['custom_post'])) {
$defaults['custom_post_id'] = $defaults['custom_post'];
@@ -499,7 +499,7 @@ public static function formRule($values, $files, $form) {
$profiles = CRM_Core_BAO_UFGroup::getProfiles($types);
//check for additional custom pre profile
- $additionalCustomPreId = CRM_Utils_Array::value('additional_custom_pre_id', $values);
+ $additionalCustomPreId = $values['additional_custom_pre_id'] ?? NULL;
if (!empty($additionalCustomPreId)) {
if (!($additionalCustomPreId == 'none')) {
$customPreId = $additionalCustomPreId;
@@ -527,7 +527,7 @@ public static function formRule($values, $files, $form) {
// We don't have required Individual fields in the pre-custom profile, so now check the post-custom profile
if ($isPreError) {
- $additionalCustomPostId = CRM_Utils_Array::value('additional_custom_post_id', $values);
+ $additionalCustomPostId = $values['additional_custom_post_id'] ?? NULL;
if (!empty($additionalCustomPostId)) {
if (!($additionalCustomPostId == 'none')) {
$customPostId = $additionalCustomPostId;
diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php
index ff9b315d5538..d99634e88bd4 100644
--- a/CRM/Event/Form/Participant.php
+++ b/CRM/Event/Form/Participant.php
@@ -266,7 +266,7 @@ public function getDefaultContext() {
*/
public function preProcess() {
parent::preProcess();
- $this->_showFeeBlock = CRM_Utils_Array::value('eventId', $_GET);
+ $this->_showFeeBlock = $_GET['eventId'] ?? NULL;
$this->assign('showFeeBlock', FALSE);
$this->assign('feeBlockPaid', FALSE);
@@ -522,7 +522,7 @@ public function setDefaultValues() {
//setting default register date
if ($this->_action == CRM_Core_Action::ADD) {
$statuses = array_flip(CRM_Event_PseudoConstant::participantStatus());
- $defaults[$this->_id]['status_id'] = CRM_Utils_Array::value('Registered', $statuses);
+ $defaults[$this->_id]['status_id'] = $statuses['Registered'] ?? NULL;
if (!empty($defaults[$this->_id]['event_id'])) {
$contributionTypeId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event',
$defaults[$this->_id]['event_id'],
@@ -893,13 +893,13 @@ public static function formRule($values, $files, $self) {
// for this event.
if ($self->_single && ($self->_action & CRM_Core_Action::ADD)) {
if ($self->_context == 'standalone') {
- $contactId = CRM_Utils_Array::value('contact_id', $values);
+ $contactId = $values['contact_id'] ?? NULL;
}
else {
$contactId = $self->_contactId;
}
- $eventId = CRM_Utils_Array::value('event_id', $values);
+ $eventId = $values['event_id'] ?? NULL;
$event = new CRM_Event_DAO_Event();
$event->id = $eventId;
@@ -1061,7 +1061,7 @@ public function submit($params) {
// overwrite actual payment amount if entered
if (!empty($params['total_amount'])) {
- $contributionParams['total_amount'] = CRM_Utils_Array::value('total_amount', $params);
+ $contributionParams['total_amount'] = $params['total_amount'] ?? NULL;
}
// Retrieve the name and email of the current user - this will be the FROM for the receipt email
@@ -1337,7 +1337,7 @@ public function submit($params) {
];
foreach ($recordContribution as $f) {
- $contributionParams[$f] = CRM_Utils_Array::value($f, $this->_params);
+ $contributionParams[$f] = $this->_params[$f] ?? NULL;
if ($f == 'trxn_id') {
$this->assign('trxn_id', $contributionParams[$f]);
}
@@ -1548,7 +1548,7 @@ public function submit($params) {
// fix amount for each of participants ( for bulk mode )
$eventAmount = [];
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$totalTaxAmount = 0;
//add dataArray in the receipts in ADD and UPDATE condition
@@ -1567,7 +1567,7 @@ public function submit($params) {
$dataArray[(string) $value['tax_rate']] = $dataArray[(string) $value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value);
}
else {
- $dataArray[(string) $value['tax_rate']] = CRM_Utils_Array::value('tax_amount', $value);
+ $dataArray[(string) $value['tax_rate']] = $value['tax_amount'] ?? NULL;
}
}
}
@@ -1606,8 +1606,8 @@ public function submit($params) {
$sendTemplateParams['from'] = $receiptFrom;
$sendTemplateParams['toName'] = $this->_contributorDisplayName;
$sendTemplateParams['toEmail'] = $this->_contributorEmail;
- $sendTemplateParams['cc'] = CRM_Utils_Array::value('cc', $this->_fromEmails);
- $sendTemplateParams['bcc'] = CRM_Utils_Array::value('bcc', $this->_fromEmails);
+ $sendTemplateParams['cc'] = $this->_fromEmails['cc'] ?? NULL;
+ $sendTemplateParams['bcc'] = $this->_fromEmails['bcc'] ?? NULL;
}
//send email with pdf invoice
@@ -1617,7 +1617,7 @@ public function submit($params) {
$this->_id, 'contribution_id', 'participant_id'
);
$prefixValue = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
+ $invoicing = $prefixValue['invoicing'] ?? NULL;
if (!empty($taxAmt) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
$sendTemplateParams['isEmailPdf'] = TRUE;
$sendTemplateParams['contributionId'] = $contributionId;
@@ -1627,7 +1627,7 @@ public function submit($params) {
$sent[] = $contactID;
foreach ($participants as $ids => $values) {
if ($values->contact_id == $contactID) {
- $values->details = CRM_Utils_Array::value('receipt_text', $params);
+ $values->details = $params['receipt_text'] ?? NULL;
CRM_Activity_BAO_Activity::addActivity($values, 'Email');
break;
}
@@ -1732,7 +1732,7 @@ public function buildEventFeeForm($form) {
CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId);
$lineItem = [];
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$totalTaxAmount = 0;
if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) {
$lineItem[] = $form->_values['line_items'];
@@ -1907,8 +1907,8 @@ protected function preparePaidEventProcessing($params): array {
//CRM-11529 for quick config backoffice transactions
//when financial_type_id is passed in form, update the
//lineitems with the financial type selected in form
- $submittedFinancialType = CRM_Utils_Array::value('financial_type_id', $params);
- $isPaymentRecorded = CRM_Utils_Array::value('record_contribution', $params);
+ $submittedFinancialType = $params['financial_type_id'] ?? NULL;
+ $isPaymentRecorded = $params['record_contribution'] ?? NULL;
if ($isPaymentRecorded && $this->_quickConfig && $submittedFinancialType) {
foreach ($lineItem[0] as &$values) {
$values['financial_type_id'] = $submittedFinancialType;
@@ -1984,7 +1984,7 @@ protected function assignEventDetailsToTpl($eventID, $participantRoles, $receipt
$event['participant_role'] = implode(', ', $selectedRoles);
}
else {
- $event['participant_role'] = CRM_Utils_Array::value($participantRoles, $role);
+ $event['participant_role'] = $role[$participantRoles] ?? NULL;
}
$event['is_monetary'] = $isPaidEvent;
diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php
index bc604dbbc2f9..9cfa7ce2dab2 100644
--- a/CRM/Event/Form/ParticipantFeeSelection.php
+++ b/CRM/Event/Form/ParticipantFeeSelection.php
@@ -296,7 +296,7 @@ public function emailReceipt(&$params) {
unset($event['end_date']);
$role = CRM_Event_PseudoConstant::participantRole();
- $participantRoles = CRM_Utils_Array::value('role_id', $params);
+ $participantRoles = $params['role_id'] ?? NULL;
if (is_array($participantRoles)) {
$selectedRoles = [];
foreach (array_keys($participantRoles) as $roleId) {
@@ -305,7 +305,7 @@ public function emailReceipt(&$params) {
$event['participant_role'] = implode(', ', $selectedRoles);
}
else {
- $event['participant_role'] = CRM_Utils_Array::value($participantRoles, $role);
+ $event['participant_role'] = $role[$participantRoles] ?? NULL;
}
$event['is_monetary'] = $this->_isPaidEvent;
@@ -374,8 +374,8 @@ public function emailReceipt(&$params) {
$sendTemplateParams['from'] = $receiptFrom;
$sendTemplateParams['toName'] = $this->_contributorDisplayName;
$sendTemplateParams['toEmail'] = $this->_contributorEmail;
- $sendTemplateParams['cc'] = CRM_Utils_Array::value('cc', $this->_fromEmails);
- $sendTemplateParams['bcc'] = CRM_Utils_Array::value('bcc', $this->_fromEmails);
+ $sendTemplateParams['cc'] = $this->_fromEmails['cc'] ?? NULL;
+ $sendTemplateParams['bcc'] = $this->_fromEmails['bcc'] ?? NULL;
}
list($mailSent, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
diff --git a/CRM/Event/Form/ParticipantView.php b/CRM/Event/Form/ParticipantView.php
index 0d67d1033edc..efe72c2e7872 100644
--- a/CRM/Event/Form/ParticipantView.php
+++ b/CRM/Event/Form/ParticipantView.php
@@ -117,7 +117,7 @@ public function preProcess() {
$values[$participantID]['lineItem'][] = $lineItem;
}
- $values[$participantID]['totalAmount'] = CRM_Utils_Array::value('fee_amount', $values[$participantID]);
+ $values[$participantID]['totalAmount'] = $values[$participantID]['fee_amount'] ?? NULL;
// Get registered_by contact ID and display_name if participant was registered by someone else (CRM-4859)
if (!empty($values[$participantID]['participant_registered_by_id'])) {
@@ -193,7 +193,7 @@ public function preProcess() {
$participantCount = [];
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$totalTaxAmount = 0;
foreach ($lineItem as $k => $v) {
if (CRM_Utils_Array::value('participant_count', $lineItem[$k]) > 0) {
@@ -211,7 +211,7 @@ public function preProcess() {
// omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
CRM_Utils_System::setTitle(ts('View Event Registration for') . ' ' . $displayName);
- $roleId = CRM_Utils_Array::value('role_id', $values[$participantID]);
+ $roleId = $values[$participantID]['role_id'] ?? NULL;
$title = $displayName . ' (' . CRM_Utils_Array::value($roleId, $participantRoles) . ' - ' . $eventTitle . ')';
$sep = CRM_Core_DAO::VALUE_SEPARATOR;
diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php
index 007e9b40176e..efa71d460556 100644
--- a/CRM/Event/Form/Registration.php
+++ b/CRM/Event/Form/Registration.php
@@ -238,7 +238,7 @@ public function preProcess() {
$params = array('id' => $this->_eventId);
CRM_Event_BAO_Event::retrieve($params, $this->_values['event']);
// check for is_monetary status
- $isMonetary = CRM_Utils_Array::value('is_monetary', $this->_values['event']);
+ $isMonetary = $this->_values['event']['is_monetary'] ?? NULL;
// check for ability to add contributions of type
if ($isMonetary
&& CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()
@@ -272,7 +272,7 @@ public function preProcess() {
if ($eventFull && !$this->_allowConfirmation) {
$this->_isEventFull = TRUE;
//lets redirecting to info only when to waiting list.
- $this->_allowWaitlist = CRM_Utils_Array::value('has_waitlist', $this->_values['event']);
+ $this->_allowWaitlist = $this->_values['event']['has_waitlist'] ?? NULL;
if (!$this->_allowWaitlist) {
CRM_Utils_System::redirect($infoUrl);
}
@@ -380,21 +380,21 @@ public function preProcess() {
// we do not want to display recently viewed items on Registration pages
$this->assign('displayRecent', FALSE);
- $isShowLocation = CRM_Utils_Array::value('is_show_location', $this->_values['event']);
+ $isShowLocation = $this->_values['event']['is_show_location'] ?? NULL;
$this->assign('isShowLocation', $isShowLocation);
// Handle PCP
$pcpId = CRM_Utils_Request::retrieve('pcpId', 'Positive', $this);
if ($pcpId) {
$pcp = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'event', $this->_values['event']);
$this->_pcpId = $pcp['pcpId'];
- $this->_values['event']['intro_text'] = CRM_Utils_Array::value('intro_text', $pcp['pcpInfo']);
+ $this->_values['event']['intro_text'] = $pcp['pcpInfo']['intro_text'] ?? NULL;
}
// assign all event properties so wizard templates can display event info.
$this->assign('event', $this->_values['event']);
$this->assign('location', $this->_values['location']);
$this->assign('bltID', $this->_bltID);
- $isShowLocation = CRM_Utils_Array::value('is_show_location', $this->_values['event']);
+ $isShowLocation = $this->_values['event']['is_show_location'] ?? NULL;
$this->assign('isShowLocation', $isShowLocation);
CRM_Contribute_BAO_Contribution_Utils::overrideDefaultCurrency($this->_values['event']);
@@ -405,13 +405,13 @@ public function preProcess() {
}
// Set the same value for is_billing_required as contribution page so code can be shared.
- $this->_values['is_billing_required'] = CRM_Utils_Array::value('is_billing_required', $this->_values['event']);
+ $this->_values['is_billing_required'] = $this->_values['event']['is_billing_required'] ?? NULL;
// check if billing block is required for pay later
// note that I have started removing the use of isBillingAddressRequiredForPayLater in favour of letting
// the CRM_Core_Payment_Manual class handle it - but there are ~300 references to it in the code base so only
// removing in very limited cases.
if (!empty($this->_values['event']['is_pay_later'])) {
- $this->_isBillingAddressRequiredForPayLater = CRM_Utils_Array::value('is_billing_required', $this->_values['event']);
+ $this->_isBillingAddressRequiredForPayLater = $this->_values['event']['is_billing_required'] ?? NULL;
$this->assign('isBillingAddressRequiredForPayLater', $this->_isBillingAddressRequiredForPayLater);
}
}
@@ -630,8 +630,8 @@ public static function initEventFee(&$form, $eventID, $includeExpiredFields = TR
if (is_array($discountedEvent)) {
foreach ($discountedEvent as $key => $priceSetId) {
$priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId);
- $priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
- $form->_values['discount'][$key] = CRM_Utils_Array::value('fields', $priceSet);
+ $priceSet = $priceSet[$priceSetId] ?? NULL;
+ $form->_values['discount'][$key] = $priceSet['fields'] ?? NULL;
$fieldID = key($form->_values['discount'][$key]);
$form->_values['discount'][$key][$fieldID]['name'] = CRM_Core_DAO::getFieldValue(
'CRM_Price_DAO_PriceSet',
@@ -641,7 +641,7 @@ public static function initEventFee(&$form, $eventID, $includeExpiredFields = TR
}
}
}
- $eventFee = CRM_Utils_Array::value('fee', $form->_values);
+ $eventFee = $form->_values['fee'] ?? NULL;
if (!is_array($eventFee) || empty($eventFee)) {
$form->_values['fee'] = array();
}
@@ -651,7 +651,7 @@ public static function initEventFee(&$form, $eventID, $includeExpiredFields = TR
$isPaidEvent = $form->_isPaidEvent;
}
else {
- $isPaidEvent = CRM_Utils_Array::value('is_monetary', $form->_values['event']);
+ $isPaidEvent = $form->_values['event']['is_monetary'] ?? NULL;
}
if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()
&& !empty($form->_values['fee'])
@@ -912,7 +912,7 @@ public static function getParticipantCount(&$form, $params, $skipCurrent = FALSE
$count = 1;
$usedCache = FALSE;
- $cacheCount = CRM_Utils_Array::value($key, $form->_lineItemParticipantsCount);
+ $cacheCount = $form->_lineItemParticipantsCount[$key] ?? NULL;
if ($cacheCount && is_numeric($cacheCount)) {
$count = $cacheCount;
$usedCache = TRUE;
@@ -1212,7 +1212,7 @@ public static function resetSubmittedValue($elementName, $optionIds = array(), &
if (!is_array($values) || empty($values)) {
continue;
}
- $eleVal = CRM_Utils_Array::value($elementName, $values);
+ $eleVal = $values[$elementName] ?? NULL;
if (empty($eleVal)) {
continue;
}
@@ -1567,7 +1567,7 @@ public function processRegistration($params, $contactID = NULL) {
//lets get additional participant id to cancel.
if ($this->_allowConfirmation && is_array($cancelledIds)) {
- $additonalId = CRM_Utils_Array::value('participant_id', $value);
+ $additonalId = $value['participant_id'] ?? NULL;
if ($additonalId && $key = array_search($additonalId, $cancelledIds)) {
unset($cancelledIds[$key]);
}
diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php
index 679139f75726..c29163ef0a73 100644
--- a/CRM/Event/Form/Registration/AdditionalParticipant.php
+++ b/CRM/Event/Form/Registration/AdditionalParticipant.php
@@ -39,7 +39,7 @@ public function preProcess() {
//lets process in-queue participants.
if ($this->_participantId && $this->_additionalParticipantIds) {
- $this->_additionalParticipantId = CRM_Utils_Array::value($participantNo, $this->_additionalParticipantIds);
+ $this->_additionalParticipantId = $this->_additionalParticipantIds[$participantNo] ?? NULL;
}
$participantCnt = $participantNo + 1;
@@ -130,7 +130,7 @@ public function setDefaultValues() {
//load default campaign from page.
if (array_key_exists('participant_campaign_id', $this->_fields)) {
- $defaults['participant_campaign_id'] = CRM_Utils_Array::value('campaign_id', $this->_values['event']);
+ $defaults['participant_campaign_id'] = $this->_values['event']['campaign_id'] ?? NULL;
}
//CRM-17865 set custom field defaults
@@ -215,7 +215,7 @@ public function buildQuickForm() {
//lets allow to become a part of runtime waiting list, if primary selected pay later.
$realPayLater = FALSE;
if (!empty($this->_values['event']['is_monetary']) && !empty($this->_values['event']['is_pay_later'])) {
- $realPayLater = CRM_Utils_Array::value('is_pay_later', $this->_params[0]);
+ $realPayLater = $this->_params[0]['is_pay_later'] ?? NULL;
}
//truly spaces are greater than required.
@@ -360,7 +360,7 @@ public static function formRule($fields, $files, $self) {
$realPayLater = FALSE;
if (!empty($self->_values['event']['is_monetary']) && !empty($self->_values['event']['is_pay_later'])) {
- $realPayLater = CRM_Utils_Array::value('is_pay_later', $self->_params[0]);
+ $realPayLater = $self->_params[0]['is_pay_later'] ?? NULL;
}
if ($button != 'skip') {
@@ -579,7 +579,7 @@ public function postProcess() {
$params['campaign_id'] = $params['participant_campaign_id'];
}
else {
- $params['campaign_id'] = CRM_Utils_Array::value('campaign_id', $this->_values['event']);
+ $params['campaign_id'] = $this->_values['event']['campaign_id'] ?? NULL;
}
// if waiting is enabled
diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php
index 060df998c8c8..de6fbdda90e4 100644
--- a/CRM/Event/Form/Registration/Confirm.php
+++ b/CRM/Event/Form/Registration/Confirm.php
@@ -426,7 +426,7 @@ public function postProcess() {
}
//lets get additional participant id to cancel.
if ($this->_allowConfirmation && is_array($cancelledIds)) {
- $additonalId = CRM_Utils_Array::value('participant_id', $record);
+ $additonalId = $record['participant_id'] ?? NULL;
if ($additonalId && $key = array_search($additonalId, $cancelledIds)) {
unset($cancelledIds[$key]);
}
@@ -473,7 +473,7 @@ public function postProcess() {
//Unset ContactID for additional participants and set RegisterBy Id.
if (empty($value['is_primary'])) {
- $contactID = CRM_Utils_Array::value('contact_id', $value);
+ $contactID = $value['contact_id'] ?? NULL;
$registerByID = $this->get('registerByID');
if ($registerByID) {
$value['registered_by_id'] = $registerByID;
@@ -600,7 +600,7 @@ public function postProcess() {
//CRM-4453.
if (!empty($value['is_primary'])) {
- $primaryCurrencyID = CRM_Utils_Array::value('currencyID', $value);
+ $primaryCurrencyID = $value['currencyID'] ?? NULL;
}
if (empty($value['currencyID'])) {
$value['currencyID'] = $primaryCurrencyID;
@@ -619,12 +619,12 @@ public function postProcess() {
}
}
- $value['fee_amount'] = CRM_Utils_Array::value('amount', $value);
+ $value['fee_amount'] = $value['amount'] ?? NULL;
$this->set('value', $value);
// handle register date CRM-4320
if ($this->_allowConfirmation) {
- $registerDate = CRM_Utils_Array::value('participant_register_date', $params);
+ $registerDate = $params['participant_register_date'] ?? NULL;
}
elseif (!empty($params['participant_register_date']) &&
is_array($params['participant_register_date'])
@@ -683,7 +683,7 @@ public function postProcess() {
$dataArray[$line['tax_rate']] = $dataArray[$line['tax_rate']] + CRM_Utils_Array::value('tax_amount', $line);
}
else {
- $dataArray[$line['tax_rate']] = CRM_Utils_Array::value('tax_amount', $line);
+ $dataArray[$line['tax_rate']] = $line['tax_amount'] ?? NULL;
}
}
}
@@ -1156,7 +1156,7 @@ public static function updateContactFields($contactID, $params, $fields, &$form)
//get email primary first if exist
$subscriptionEmail = ['email' => CRM_Utils_Array::value('email-Primary', $params)];
if (!$subscriptionEmail['email']) {
- $subscriptionEmail['email'] = CRM_Utils_Array::value("email-{$form->_bltID}", $params);
+ $subscriptionEmail['email'] = $params["email-{$form->_bltID}"] ?? NULL;
}
// subscribing contact to groups
if (!empty($subscribeGroupIds) && $subscriptionEmail['email']) {
@@ -1200,7 +1200,7 @@ public static function assignProfiles($form) {
if (count($values)) {
$formattedValues[$count][$prefix1 . 'CustomPre'] = $values;
}
- $formattedValues[$count][$prefix1 . 'CustomPreGroupTitle'] = CRM_Utils_Array::value('groupTitle', $groupName);
+ $formattedValues[$count][$prefix1 . 'CustomPreGroupTitle'] = $groupName['groupTitle'] ?? NULL;
}
//get the customPost profile info
if (!empty($form->_values[$prefix2 . 'custom_post_id'])) {
@@ -1259,9 +1259,9 @@ public static function testSubmit($params) {
// This happens in buildQuickForm so emulate here.
$form->_amount = $form->_totalAmount = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('totalAmount', $params));
$form->set('params', $params['params']);
- $form->_values['custom_pre_id'] = CRM_Utils_Array::value('custom_pre_id', $params);
- $form->_values['custom_post_id'] = CRM_Utils_Array::value('custom_post_id', $params);
- $form->_values['event'] = CRM_Utils_Array::value('event', $params);
+ $form->_values['custom_pre_id'] = $params['custom_pre_id'] ?? NULL;
+ $form->_values['custom_post_id'] = $params['custom_post_id'] ?? NULL;
+ $form->_values['event'] = $params['event'] ?? NULL;
$form->_contributeMode = $params['contributeMode'];
$eventParams = ['id' => $params['id']];
CRM_Event_BAO_Event::retrieve($eventParams, $form->_values['event']);
diff --git a/CRM/Event/Form/Registration/ParticipantConfirm.php b/CRM/Event/Form/Registration/ParticipantConfirm.php
index 6c23fce62082..4a4b95b5c0c5 100644
--- a/CRM/Event/Form/Registration/ParticipantConfirm.php
+++ b/CRM/Event/Form/Registration/ParticipantConfirm.php
@@ -50,9 +50,9 @@ public function preProcess() {
);
}
- $this->_participantStatusId = CRM_Utils_Array::value('status_id', $values);
- $this->_eventId = CRM_Utils_Array::value('event_id', $values);
- $csContactId = CRM_Utils_Array::value('contact_id', $values);
+ $this->_participantStatusId = $values['status_id'] ?? NULL;
+ $this->_eventId = $values['event_id'] ?? NULL;
+ $csContactId = $values['contact_id'] ?? NULL;
// make sure we have right permission to edit this user
$this->_csContactID = NULL;
diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php
index acbc6afed2f6..e480c84c092b 100644
--- a/CRM/Event/Form/Registration/Register.php
+++ b/CRM/Event/Form/Registration/Register.php
@@ -152,7 +152,7 @@ public function preProcess() {
$this->_allowWaitlist = FALSE;
if ($eventFull && !$this->_allowConfirmation && !empty($this->_values['event']['has_waitlist'])) {
$this->_allowWaitlist = TRUE;
- $this->_waitlistMsg = CRM_Utils_Array::value('waitlist_text', $this->_values['event']);
+ $this->_waitlistMsg = $this->_values['event']['waitlist_text'] ?? NULL;
if (!$this->_waitlistMsg) {
$this->_waitlistMsg = ts('This event is currently full. However you can register now and get added to a waiting list. You will be notified if spaces become available.');
}
@@ -523,14 +523,14 @@ public static function buildAmount(&$form, $required = TRUE, $discountId = NULL)
return;
}
- $feeFields = CRM_Utils_Array::value('fee', $form->_values);
+ $feeFields = $form->_values['fee'] ?? NULL;
if (is_array($feeFields)) {
$form->_feeBlock = &$form->_values['fee'];
}
//check for discount.
- $discountedFee = CRM_Utils_Array::value('discount', $form->_values);
+ $discountedFee = $form->_values['discount'] ?? NULL;
if (is_array($discountedFee) && !empty($discountedFee)) {
if (!$discountId) {
$form->_discountId = $discountId = CRM_Core_BAO_Discount::findSet($form->_eventId, 'civicrm_event');
@@ -586,13 +586,13 @@ public static function buildAmount(&$form, $required = TRUE, $discountId = NULL)
$fieldId = $field['id'];
$elementName = 'price_' . $fieldId;
- $isRequire = CRM_Utils_Array::value('is_required', $field);
+ $isRequire = $field['is_required'] ?? NULL;
if ($button == 'skip') {
$isRequire = FALSE;
}
//user might modified w/ hook.
- $options = CRM_Utils_Array::value('options', $field);
+ $options = $field['options'] ?? NULL;
$formClasses = ['CRM_Event_Form_Participant', 'CRM_Event_Form_ParticipantFeeSelection'];
if (!is_array($options)) {
@@ -654,7 +654,7 @@ public static function buildAmount(&$form, $required = TRUE, $discountId = NULL)
}
$form->assign('eventFeeBlockValues', json_encode($eventFeeBlockValues));
- $form->_defaults['amount'] = CRM_Utils_Array::value('default_fee_id', $form->_values['event']);
+ $form->_defaults['amount'] = $form->_values['event']['default_fee_id'] ?? NULL;
$element = &$form->addGroup($elements, 'amount', ts('Event Fee(s)'), '
');
if (isset($form->_online) && $form->_online) {
$element->freeze();
@@ -967,7 +967,7 @@ public function postProcess() {
$params['campaign_id'] = $params['participant_campaign_id'];
}
else {
- $params['campaign_id'] = CRM_Utils_Array::value('campaign_id', $this->_values['event']);
+ $params['campaign_id'] = $this->_values['event']['campaign_id'] ?? NULL;
}
//hack to allow group to register w/ waiting
diff --git a/CRM/Event/Form/SelfSvcTransfer.php b/CRM/Event/Form/SelfSvcTransfer.php
index 6dc21ffd9924..d44012ff4185 100644
--- a/CRM/Event/Form/SelfSvcTransfer.php
+++ b/CRM/Event/Form/SelfSvcTransfer.php
@@ -432,14 +432,14 @@ public function participantTransfer($participant) {
$eventParams = ['id' => $participant->event_id];
CRM_Event_BAO_Event::retrieve($eventParams, $eventDetails);
//get default participant role.
- $eventDetails['participant_role'] = CRM_Utils_Array::value($eventDetails['default_role_id'], $participantRoles);
+ $eventDetails['participant_role'] = $participantRoles[$eventDetails['default_role_id']] ?? NULL;
//get the location info
$locParams = [
'entity_id' => $participant->event_id,
'entity_table' => 'civicrm_event',
];
$eventDetails['location'] = CRM_Core_BAO_Location::getValues($locParams, TRUE);
- $toEmail = CRM_Utils_Array::value('email', $contactDetails[$participant->contact_id]);
+ $toEmail = $contactDetails[$participant->contact_id]['email'] ?? NULL;
if ($toEmail) {
//take a receipt from as event else domain.
$receiptFrom = $domainValues['name'] . ' <' . $domainValues['email'] . '>';
@@ -512,7 +512,7 @@ public function sendCancellation() {
$eventParams = ['id' => $this->_event_id];
CRM_Event_BAO_Event::retrieve($eventParams, $eventDetails[$this->_event_id]);
//get default participant role.
- $eventDetails[$this->_event_id]['participant_role'] = CRM_Utils_Array::value($eventDetails[$this->_event_id]['default_role_id'], $participantRoles);
+ $eventDetails[$this->_event_id]['participant_role'] = $participantRoles[$eventDetails[$this->_event_id]['default_role_id']] ?? NULL;
//get the location info
$locParams = ['entity_id' => $this->_event_id, 'entity_table' => 'civicrm_event'];
$eventDetails[$this->_event_id]['location'] = CRM_Core_BAO_Location::getValues($locParams, TRUE);
diff --git a/CRM/Event/Form/SelfSvcUpdate.php b/CRM/Event/Form/SelfSvcUpdate.php
index 760478a0588d..33b9f7f3f878 100644
--- a/CRM/Event/Form/SelfSvcUpdate.php
+++ b/CRM/Event/Form/SelfSvcUpdate.php
@@ -289,7 +289,7 @@ public function cancelParticipant($params) {
$eventParams = ['id' => $this->_event_id];
CRM_Event_BAO_Event::retrieve($eventParams, $eventDetails[$this->_event_id]);
//get default participant role.
- $eventDetails[$this->_event_id]['participant_role'] = CRM_Utils_Array::value($eventDetails[$this->_event_id]['default_role_id'], $participantRoles);
+ $eventDetails[$this->_event_id]['participant_role'] = $participantRoles[$eventDetails[$this->_event_id]['default_role_id']] ?? NULL;
//get the location info
$locParams = ['entity_id' => $this->_event_id, 'entity_table' => 'civicrm_event'];
$eventDetails[$this->_event_id]['location'] = CRM_Core_BAO_Location::getValues($locParams, TRUE);
diff --git a/CRM/Event/Form/Task/AddToGroup.php b/CRM/Event/Form/Task/AddToGroup.php
index 69d7f6a5ddd5..87c47c3fa6ee 100644
--- a/CRM/Event/Form/Task/AddToGroup.php
+++ b/CRM/Event/Form/Task/AddToGroup.php
@@ -189,7 +189,7 @@ public static function formRule($params) {
*/
public function postProcess() {
$params = $this->controller->exportValues();
- $groupOption = CRM_Utils_Array::value('group_option', $params, NULL);
+ $groupOption = $params['group_option'] ?? NULL;
if ($groupOption) {
$groupParams = [];
$groupParams['title'] = $params['title'];
diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php
index 2bd7321de6bd..3979b29edd7e 100644
--- a/CRM/Event/Form/Task/Batch.php
+++ b/CRM/Event/Form/Task/Batch.php
@@ -165,14 +165,14 @@ public function buildQuickForm() {
$eventTypeId = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $eventId, 'event_type_id');
foreach ($this->_fields as $name => $field) {
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {
- $customValue = CRM_Utils_Array::value($customFieldID, $this->_customFields);
+ $customValue = $this->_customFields[$customFieldID] ?? NULL;
$entityColumnValue = [];
if (!empty($customValue['extends_entity_column_value'])) {
$entityColumnValue = explode(CRM_Core_DAO::VALUE_SEPARATOR,
$customValue['extends_entity_column_value']
);
}
- $entityColumnValueRole = CRM_Utils_Array::value($roleId, $entityColumnValue);
+ $entityColumnValueRole = $entityColumnValue[$roleId] ?? NULL;
$entityColumnValueEventType = in_array($eventTypeId, $entityColumnValue) ? $eventTypeId : NULL;
if (($this->_roleCustomDataTypeID == $customValue['extends_entity_column_id']) &&
($entityColumnValueRole)
@@ -235,7 +235,7 @@ public function setDefaultValues() {
//get the from status ids, CRM-4323
if (array_key_exists('participant_status', $this->_fields)) {
- $this->_fromStatusIds[$participantId] = CRM_Utils_Array::value("field[$participantId][participant_status]", $defaults);
+ $this->_fromStatusIds[$participantId] = $defaults["field[$participantId][participant_status]"] ?? NULL;
}
if (array_key_exists('participant_role', $this->_fields)) {
if ($defaults["field[{$participantId}][participant_role]"]) {
@@ -325,10 +325,10 @@ public static function updatePendingOnlineContribution($participantId, $statusId
*/
public static function updateContributionStatus($params) {
// get minimum required values.
- $statusId = CRM_Utils_Array::value('contribution_status_id', $params);
- $componentId = CRM_Utils_Array::value('component_id', $params);
- $componentName = CRM_Utils_Array::value('componentName', $params);
- $contributionId = CRM_Utils_Array::value('contribution_id', $params);
+ $statusId = $params['contribution_status_id'] ?? NULL;
+ $componentId = $params['component_id'] ?? NULL;
+ $componentName = $params['componentName'] ?? NULL;
+ $contributionId = $params['contribution_id'] ?? NULL;
if (!$contributionId || !$componentId || !$componentName || !$statusId) {
return NULL;
@@ -383,7 +383,7 @@ public static function updateContributionStatus($params) {
'labelColumn' => 'name',
'flip' => 1,
]);
- $input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'] = CRM_Utils_Array::value('IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved', $params);
+ $input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'] = $params['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'] ?? NULL;
if ($statusId == $contributionStatuses['Cancelled']) {
$baseIPN->cancelled($objects, $transaction, $input);
$transaction->commit();
@@ -487,7 +487,7 @@ public function submit($params) {
$relatedStatusChange = FALSE;
if (!empty($value['participant_status'])) {
$value['status_id'] = $value['participant_status'];
- $fromStatusId = CRM_Utils_Array::value($key, $this->_fromStatusIds);
+ $fromStatusId = $this->_fromStatusIds[$key] ?? NULL;
if (!$fromStatusId) {
$fromStatusId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $key, 'status_id');
}
diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php
index 6e0f51c1e0a6..b418566f2b28 100644
--- a/CRM/Event/Import/Form/MapField.php
+++ b/CRM/Event/Import/Form/MapField.php
@@ -100,9 +100,9 @@ public function buildQuickForm() {
$mappingName = $mappingName[1];
$mappingContactType = $mappingContactType[1];
- $mappingLocation = CRM_Utils_Array::value('1', $mappingLocation);
- $mappingPhoneType = CRM_Utils_Array::value('1', $mappingPhoneType);
- $mappingRelation = CRM_Utils_Array::value('1', $mappingRelation);
+ $mappingLocation = $mappingLocation['1'] ?? NULL;
+ $mappingPhoneType = $mappingPhoneType['1'] ?? NULL;
+ $mappingRelation = $mappingRelation['1'] ?? NULL;
//mapping is to be loaded from database
@@ -339,7 +339,7 @@ public static function formRule($fields, $files, $self) {
}
if (!empty($fields['saveMapping'])) {
- $nameField = CRM_Utils_Array::value('saveMappingName', $fields);
+ $nameField = $fields['saveMappingName'] ?? NULL;
if (empty($nameField)) {
$errors['saveMappingName'] = ts('Name is required to save Import Mapping');
}
@@ -352,7 +352,7 @@ public static function formRule($fields, $files, $self) {
//display Error if loaded mapping is not selected
if (array_key_exists('loadMapping', $fields)) {
- $getMapName = CRM_Utils_Array::value('savedMapping', $fields);
+ $getMapName = $fields['savedMapping'] ?? NULL;
if (empty($getMapName)) {
$errors['savedMapping'] = ts('Select saved mapping');
}
@@ -428,9 +428,9 @@ public function postProcess() {
$updateMappingFields->column_number = $i;
$explodedValues = explode('_', $mapperKeys[$i][0]);
- $id = CRM_Utils_Array::value(0, $explodedValues);
- $first = CRM_Utils_Array::value(1, $explodedValues);
- $second = CRM_Utils_Array::value(2, $explodedValues);
+ $id = $explodedValues[0] ?? NULL;
+ $first = $explodedValues[1] ?? NULL;
+ $second = $explodedValues[2] ?? NULL;
$updateMappingFields->name = $mapper[$i];
$updateMappingFields->save();
@@ -452,9 +452,9 @@ public function postProcess() {
$saveMappingFields->column_number = $i;
$explodedValues = explode('_', $mapperKeys[$i][0]);
- $id = CRM_Utils_Array::value(0, $explodedValues);
- $first = CRM_Utils_Array::value(1, $explodedValues);
- $second = CRM_Utils_Array::value(2, $explodedValues);
+ $id = $explodedValues[0] ?? NULL;
+ $first = $explodedValues[1] ?? NULL;
+ $second = $explodedValues[2] ?? NULL;
$saveMappingFields->name = $mapper[$i];
$saveMappingFields->save();
diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php
index 7e362d540a9a..c5c47da4c6d8 100644
--- a/CRM/Event/Import/Parser/Participant.php
+++ b/CRM/Event/Import/Parser/Participant.php
@@ -443,8 +443,8 @@ public function import($onDuplicate, &$values) {
if (is_array($newParticipant) && civicrm_error($newParticipant)) {
if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
- $contactID = CRM_Utils_Array::value('contactID', $newParticipant);
- $participantID = CRM_Utils_Array::value('participantID', $newParticipant);
+ $contactID = $newParticipant['contactID'] ?? NULL;
+ $participantID = $newParticipant['participantID'] ?? NULL;
$url = CRM_Utils_System::url('civicrm/contact/view/participant',
"reset=1&id={$participantID}&cid={$contactID}&action=view", TRUE
);
@@ -463,7 +463,7 @@ public function import($onDuplicate, &$values) {
}
if (!(is_array($newParticipant) && civicrm_error($newParticipant))) {
- $this->_newParticipants[] = CRM_Utils_Array::value('id', $newParticipant);
+ $this->_newParticipants[] = $newParticipant['id'] ?? NULL;
}
return CRM_Import_Parser::VALID;
@@ -535,8 +535,8 @@ protected function formatValues(&$values, $params) {
elseif ($type == 'Select' || $type == 'Radio') {
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE);
foreach ($customOption as $customFldID => $customValue) {
- $val = CRM_Utils_Array::value('value', $customValue);
- $label = CRM_Utils_Array::value('label', $customValue);
+ $val = $customValue['value'] ?? NULL;
+ $label = $customValue['label'] ?? NULL;
$label = strtolower($label);
$value = strtolower(trim($value));
if (($value == $label) || ($value == strtolower($val))) {
diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php
index e78686c32510..c07681da8bbc 100644
--- a/CRM/Event/Page/EventInfo.php
+++ b/CRM/Event/Page/EventInfo.php
@@ -117,7 +117,7 @@ public function run() {
$values['feeBlock']['value'][$fieldCnt] = '';
$values['feeBlock']['label'][$fieldCnt] = $fieldValues['label'];
$values['feeBlock']['lClass'][$fieldCnt] = 'price_set_option_group-label';
- $values['feeBlock']['isDisplayAmount'][$fieldCnt] = CRM_Utils_Array::value('is_display_amounts', $fieldValues);
+ $values['feeBlock']['isDisplayAmount'][$fieldCnt] = $fieldValues['is_display_amounts'] ?? NULL;
$fieldCnt++;
$labelClass = 'price_set_option-label';
}
@@ -126,9 +126,9 @@ public function run() {
}
// show tax rate with amount
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
- $displayOpt = CRM_Utils_Array::value('tax_display_settings', $invoiceSettings);
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $taxTerm = $invoiceSettings['tax_term'] ?? NULL;
+ $displayOpt = $invoiceSettings['tax_display_settings'] ?? NULL;
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
foreach ($fieldValues['options'] as $optionId => $optionVal) {
if (CRM_Utils_Array::value('visibility_id', $optionVal) != array_search('public', $visibility) &&
$adminFieldVisible == FALSE
@@ -136,7 +136,7 @@ public function run() {
continue;
}
- $values['feeBlock']['isDisplayAmount'][$fieldCnt] = CRM_Utils_Array::value('is_display_amounts', $fieldValues);
+ $values['feeBlock']['isDisplayAmount'][$fieldCnt] = $fieldValues['is_display_amounts'] ?? NULL;
if ($invoicing && isset($optionVal['tax_amount'])) {
$values['feeBlock']['value'][$fieldCnt] = CRM_Price_BAO_PriceField::getTaxLabel($optionVal, 'amount', $displayOpt, $taxTerm);
$values['feeBlock']['tax_amount'][$fieldCnt] = $optionVal['tax_amount'];
@@ -238,7 +238,7 @@ public function run() {
$this->assign('findParticipants', $findParticipants);
}
- $participantListingID = CRM_Utils_Array::value('participant_listing_id', $values['event']);
+ $participantListingID = $values['event']['participant_listing_id'] ?? NULL;
if ($participantListingID) {
$participantListingURL = CRM_Utils_System::url('civicrm/event/participant',
"reset=1&id={$this->_id}",
@@ -247,7 +247,7 @@ public function run() {
$this->assign('participantListingURL', $participantListingURL);
}
- $hasWaitingList = CRM_Utils_Array::value('has_waitlist', $values['event']);
+ $hasWaitingList = $values['event']['has_waitlist'] ?? NULL;
$eventFullMessage = CRM_Event_BAO_Participant::eventFull($this->_id,
FALSE,
$hasWaitingList
@@ -317,7 +317,7 @@ public function run() {
}
}
elseif ($hasWaitingList) {
- $statusMessage = CRM_Utils_Array::value('waitlist_text', $values['event']);
+ $statusMessage = $values['event']['waitlist_text'] ?? NULL;
if (!$statusMessage) {
$statusMessage = ts('Event is currently full, but you can register and be a part of waiting list.');
}
diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php
index a0b7c3b2836c..20b4ed5e86e0 100644
--- a/CRM/Event/Page/ManageEvent.php
+++ b/CRM/Event/Page/ManageEvent.php
@@ -416,10 +416,10 @@ public function browse() {
}
//show campaigns on selector.
- $manageEvent[$dao->id]['campaign'] = CRM_Utils_Array::value($dao->campaign_id, $allCampaigns);
+ $manageEvent[$dao->id]['campaign'] = $allCampaigns[$dao->campaign_id] ?? NULL;
$manageEvent[$dao->id]['reminder'] = CRM_Core_BAO_ActionSchedule::isConfigured($dao->id, $mapping->getId());
- $manageEvent[$dao->id]['is_pcp_enabled'] = CRM_Utils_Array::value($dao->id, $eventPCPS);
- $manageEvent[$dao->id]['event_type'] = CRM_Utils_Array::value($manageEvent[$dao->id]['event_type_id'], $eventType);
+ $manageEvent[$dao->id]['is_pcp_enabled'] = $eventPCPS[$dao->id] ?? NULL;
+ $manageEvent[$dao->id]['event_type'] = $eventType[$manageEvent[$dao->id]['event_type_id']] ?? NULL;
$manageEvent[$dao->id]['is_repeating_event'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_RecurringEntity', $dao->id, 'parent_id', 'entity_id');
// allow hooks to set 'field' value which allows configuration pop-up to show a tab as enabled/disabled
CRM_Utils_Hook::tabset('civicrm/event/manage/rows', $manageEvent, ['event_id' => $dao->id]);
diff --git a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php
index fef5ae7b12e1..8277180b5243 100644
--- a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php
+++ b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php
@@ -86,7 +86,7 @@ public function run() {
$object = CRM_Core_DAO::executeQuery($query, $params);
$statusLookup = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
while ($object->fetch()) {
- $status = CRM_Utils_Array::value($object->status_id, $statusLookup);
+ $status = $statusLookup[$object->status_id] ?? NULL;
$row = [
'id' => $object->contact_id,
'participantID' => $object->participant_id,
diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php
index 1c5f4b027a65..46dcfeb2e2c8 100644
--- a/CRM/Event/Selector/Search.php
+++ b/CRM/Event/Selector/Search.php
@@ -333,7 +333,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
}
//carry campaign on selectors.
- $row['campaign'] = CRM_Utils_Array::value($result->participant_campaign_id, $allCampaigns);
+ $row['campaign'] = $allCampaigns[$result->participant_campaign_id] ?? NULL;
$row['campaign_id'] = $result->participant_campaign_id;
// gross hack to show extra information for pending status
diff --git a/CRM/Event/StateMachine/Search.php b/CRM/Event/StateMachine/Search.php
index 0c76eb6cdef3..f98de49db6e3 100644
--- a/CRM/Event/StateMachine/Search.php
+++ b/CRM/Event/StateMachine/Search.php
@@ -71,7 +71,7 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) {
*/
public function taskName($controller, $formName = 'Search') {
// total hack, check POST vars and then session to determine stuff
- $value = CRM_Utils_Array::value('task', $_POST);
+ $value = $_POST['task'] ?? NULL;
if (!isset($value)) {
$value = $this->_controller->get('task');
}
diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php
index 8453d02475b4..9dded52787a2 100644
--- a/CRM/Export/BAO/ExportProcessor.php
+++ b/CRM/Export/BAO/ExportProcessor.php
@@ -1006,7 +1006,7 @@ public function buildRow($query, $iterationDAO, $outputColumns, $metadata, $paym
$fieldValue = $phoneTypes[$fieldValue];
}
elseif ($field == 'provider_id' || $field == 'im_provider') {
- $fieldValue = CRM_Utils_Array::value($fieldValue, $imProviders);
+ $fieldValue = $imProviders[$fieldValue] ?? NULL;
}
elseif (strstr($field, 'master_id')) {
// @todo - why not just $field === 'master_id' - what else would it be?
@@ -1031,7 +1031,7 @@ public function buildRow($query, $iterationDAO, $outputColumns, $metadata, $paym
if (!$this->isExportSpecifiedPaymentFields()) {
$nullContributionDetails = array_fill_keys(array_keys($this->getPaymentHeaders()), NULL);
if ($this->isExportPaymentFields()) {
- $paymentData = CRM_Utils_Array::value($row[$paymentTableId], $paymentDetails);
+ $paymentData = $paymentDetails[$row[$paymentTableId]] ?? NULL;
if (!is_array($paymentData) || empty($paymentData)) {
$paymentData = $nullContributionDetails;
}
@@ -1170,7 +1170,7 @@ public function getTransformedFieldValue($field, $iterationDAO, $fieldValue, $me
}
elseif ($this->isExportSpecifiedPaymentFields() && array_key_exists($field, $this->getcomponentPaymentFields())) {
$paymentTableId = $this->getPaymentTableID();
- $paymentData = CRM_Utils_Array::value($iterationDAO->$paymentTableId, $paymentDetails);
+ $paymentData = $paymentDetails[$iterationDAO->$paymentTableId] ?? NULL;
$payFieldMapper = [
'componentPaymentField_total_amount' => 'total_amount',
'componentPaymentField_contribution_status' => 'contribution_status',
@@ -1357,7 +1357,7 @@ public function getDefaultReturnProperties() {
public function setRelationshipReturnProperties($value, $relationshipKey) {
$relationField = $value['name'];
$relIMProviderId = NULL;
- $relLocTypeId = CRM_Utils_Array::value('location_type_id', $value);
+ $relLocTypeId = $value['location_type_id'] ?? NULL;
$locationName = CRM_Core_PseudoConstant::getName('CRM_Core_BAO_Address', 'location_type_id', $relLocTypeId);
$relPhoneTypeId = CRM_Utils_Array::value('phone_type_id', $value, ($locationName ? 'Primary' : NULL));
$relIMProviderId = CRM_Utils_Array::value('im_provider_id', $value, ($locationName ? 'Primary' : NULL));
@@ -2104,7 +2104,7 @@ protected function setGreetingStringsForSameAddressMerge($formValues) {
if (!empty($greetingOptions)) {
// Greeting options is keyed by 'postal_greeting' or 'addressee'.
foreach ($greetingOptions as $key => $value) {
- $option = CRM_Utils_Array::value($key, $formValues);
+ $option = $formValues[$key] ?? NULL;
if ($option) {
if ($greetingOptions[$key][$option] == ts('Other')) {
$formValues[$key] = $formValues["{$key}_other"];
@@ -2185,7 +2185,7 @@ public function fetchRelationshipDetails($relDAO, $value, $field, &$row) {
$fieldValue = $phoneTypes[$relationValue];
}
elseif ($relationField == 'provider_id') {
- $fieldValue = CRM_Utils_Array::value($relationValue, $imProviders);
+ $fieldValue = $imProviders[$relationValue] ?? NULL;
}
// CRM-13995
elseif (is_object($relDAO) && in_array($relationField, [
diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php
index 043c277154ae..af4b2bba7f5e 100644
--- a/CRM/Export/Form/Select.php
+++ b/CRM/Export/Form/Select.php
@@ -340,7 +340,7 @@ public static function formRule($params, $files, $self) {
];
foreach ($greetings as $key => $value) {
- $otherOption = CRM_Utils_Array::value($key, $params);
+ $otherOption = $params[$key] ?? NULL;
if ((CRM_Utils_Array::value($otherOption, $self->_greetingOptions[$key]) == ts('Other')) && empty($params[$value])) {
@@ -372,7 +372,7 @@ public function postProcess() {
// all submitted options or any other argument
$exportParams = $params;
- $mappingId = CRM_Utils_Array::value('mapping', $params);
+ $mappingId = $params['mapping'] ?? NULL;
if ($mappingId) {
$this->set('mappingId', $mappingId);
}
diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php
index 0b235a72ef69..9048d99028a8 100644
--- a/CRM/Financial/BAO/FinancialAccount.php
+++ b/CRM/Financial/BAO/FinancialAccount.php
@@ -379,7 +379,7 @@ public static function checkFinancialTypeHasDeferred($params, $contributionID =
if (!Civi::settings()->get('deferred_revenue_enabled')) {
return FALSE;
}
- $recognitionDate = CRM_Utils_Array::value('revenue_recognition_date', $params);
+ $recognitionDate = $params['revenue_recognition_date'] ?? NULL;
if (!(!CRM_Utils_System::isNull($recognitionDate)
|| ($contributionID && isset($params['prevContribution'])
&& !CRM_Utils_System::isNull($params['prevContribution']->revenue_recognition_date)))
@@ -387,8 +387,8 @@ public static function checkFinancialTypeHasDeferred($params, $contributionID =
return FALSE;
}
- $lineItems = CRM_Utils_Array::value('line_item', $params);
- $financialTypeID = CRM_Utils_Array::value('financial_type_id', $params);
+ $lineItems = $params['line_item'] ?? NULL;
+ $financialTypeID = $params['financial_type_id'] ?? NULL;
if (!$financialTypeID) {
$financialTypeID = $params['prevContribution']->financial_type_id;
}
diff --git a/CRM/Financial/BAO/FinancialItem.php b/CRM/Financial/BAO/FinancialItem.php
index 378f98eff628..60c6332f6c32 100644
--- a/CRM/Financial/BAO/FinancialItem.php
+++ b/CRM/Financial/BAO/FinancialItem.php
@@ -86,7 +86,7 @@ public static function add($lineItem, $contribution, $taxTrxnID = FALSE, $trxnId
if ($taxTrxnID) {
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
+ $taxTerm = $invoiceSettings['tax_term'] ?? NULL;
$params['amount'] = $lineItem->tax_amount;
$params['description'] = $taxTerm;
$accountRelName = 'Sales Tax Account is';
@@ -142,7 +142,7 @@ public static function create(&$params, $ids = NULL, $trxnIds = NULL) {
}
$financialItem->save();
- $financialtrxnIDS = CRM_Utils_Array::value('id', $trxnIds);
+ $financialtrxnIDS = $trxnIds['id'] ?? NULL;
if (!empty($financialtrxnIDS)) {
if (!is_array($financialtrxnIDS)) {
$financialtrxnIDS = [$financialtrxnIDS];
diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php
index c551d6752987..65c20c022105 100644
--- a/CRM/Financial/BAO/FinancialType.php
+++ b/CRM/Financial/BAO/FinancialType.php
@@ -90,7 +90,7 @@ public static function add(&$params, &$ids = []) {
$financialType = new CRM_Financial_DAO_FinancialType();
$financialType->copyValues($params);
if (!empty($ids['financialType'])) {
- $financialType->id = CRM_Utils_Array::value('financialType', $ids);
+ $financialType->id = $ids['financialType'] ?? NULL;
if (self::isACLFinancialTypeStatus()) {
$prevName = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $financialType->id, 'name');
if ($prevName != $params['name']) {
diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php
index 9f5e0ad55032..8a06f7f26cc3 100644
--- a/CRM/Financial/BAO/Payment.php
+++ b/CRM/Financial/BAO/Payment.php
@@ -450,7 +450,7 @@ protected static function getPayableLineItems($params): array {
$lineItems[$lineItemID]['balance'] = $lineItem['subTotal'] - $lineItems[$lineItemID]['paid'];
if (!empty($lineItemOverrides)) {
- $lineItems[$lineItemID]['allocation'] = CRM_Utils_Array::value($lineItemID, $lineItemOverrides);
+ $lineItems[$lineItemID]['allocation'] = $lineItemOverrides[$lineItemID] ?? NULL;
}
else {
$lineItems[$lineItemID]['allocation'] = $lineItems[$lineItemID]['balance'] * $ratio;
diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php
index b577a7fca64a..ef1f7ec3a421 100644
--- a/CRM/Financial/BAO/PaymentProcessor.php
+++ b/CRM/Financial/BAO/PaymentProcessor.php
@@ -262,8 +262,8 @@ public static function getTestProcessorId($id) {
* @return int
*/
public static function defaultComparison($processor1, $processor2) {
- $p1 = CRM_Utils_Array::value('is_default', $processor1);
- $p2 = CRM_Utils_Array::value('is_default', $processor2);
+ $p1 = $processor1['is_default'] ?? NULL;
+ $p2 = $processor2['is_default'] ?? NULL;
if ($p1 == $p2) {
return 0;
}
diff --git a/CRM/Financial/Form/FinancialTypeAccount.php b/CRM/Financial/Form/FinancialTypeAccount.php
index 3c0f43892034..dd5733ca2a4c 100644
--- a/CRM/Financial/Form/FinancialTypeAccount.php
+++ b/CRM/Financial/Form/FinancialTypeAccount.php
@@ -165,7 +165,7 @@ public function buildQuickForm() {
if ($this->_action == CRM_Core_Action::ADD) {
if (!empty($this->_submitValues['account_relationship']) || !empty($this->_submitValues['financial_account_id'])) {
$financialAccountType = CRM_Financial_BAO_FinancialAccount::getfinancialAccountRelations();
- $financialAccountType = CRM_Utils_Array::value($this->_submitValues['account_relationship'], $financialAccountType);
+ $financialAccountType = $financialAccountType[$this->_submitValues['account_relationship']] ?? NULL;
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
$financialAccountSelect = ['' => ts('- select -')] + $result;
diff --git a/CRM/Financial/Form/PaymentEdit.php b/CRM/Financial/Form/PaymentEdit.php
index 06acbd9521b9..f131ef76776b 100644
--- a/CRM/Financial/Form/PaymentEdit.php
+++ b/CRM/Financial/Form/PaymentEdit.php
@@ -156,11 +156,11 @@ public function postProcess() {
$paymentInstrumentName = CRM_Core_PseudoConstant::getName('CRM_Financial_DAO_FinancialTrxn', 'payment_instrument_id', $params['payment_instrument_id']);
if ($paymentInstrumentName == 'Credit Card') {
- $params['card_type_id'] = CRM_Utils_Array::value('card_type_id', $this->_submitValues);
- $params['pan_truncation'] = CRM_Utils_Array::value('pan_truncation', $this->_submitValues);
+ $params['card_type_id'] = $this->_submitValues['card_type_id'] ?? NULL;
+ $params['pan_truncation'] = $this->_submitValues['pan_truncation'] ?? NULL;
}
elseif ($paymentInstrumentName == 'Check') {
- $params['check_number'] = CRM_Utils_Array::value('check_number', $this->_submitValues);
+ $params['check_number'] = $this->_submitValues['check_number'] ?? NULL;
}
$this->submit($params);
diff --git a/CRM/Financial/Form/SalesTaxTrait.php b/CRM/Financial/Form/SalesTaxTrait.php
index 888ac75f9760..45710bd06499 100644
--- a/CRM/Financial/Form/SalesTaxTrait.php
+++ b/CRM/Financial/Form/SalesTaxTrait.php
@@ -37,7 +37,7 @@ public function assignSalesTaxRates() {
*/
public function getSalesTaxTerm() {
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
if (!$invoicing) {
return '';
}
diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php
index 25d1b262bf63..5eaae27c1cbf 100644
--- a/CRM/Financial/Page/AJAX.php
+++ b/CRM/Financial/Page/AJAX.php
@@ -38,7 +38,7 @@ public static function jqFinancial($config) {
}
else {
$financialAccountType = CRM_Financial_BAO_FinancialAccount::getfinancialAccountRelations();
- $financialAccountType = CRM_Utils_Array::value($_GET['_value'], $financialAccountType);
+ $financialAccountType = $financialAccountType[$_GET['_value']] ?? NULL;
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
if ($financialAccountType) {
$defaultId = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_financial_account WHERE is_default = 1 AND financial_account_type_id = $financialAccountType");
@@ -303,7 +303,7 @@ public static function getFinancialTransactionsList() {
$params['context'] = $context;
$params['offset'] = ($params['page'] - 1) * $params['rp'];
$params['rowCount'] = $params['rp'];
- $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
+ $params['sort'] = $params['sortBy'] ?? NULL;
$params['total'] = 0;
// get batch list
diff --git a/CRM/Financial/Page/FinancialType.php b/CRM/Financial/Page/FinancialType.php
index 7a1480d52472..38bde7596431 100644
--- a/CRM/Financial/Page/FinancialType.php
+++ b/CRM/Financial/Page/FinancialType.php
@@ -110,8 +110,8 @@ public function browse() {
foreach ($financialAccountIds as $key => $values) {
if (!empty($financialAccounts[$values['financial_account_id']])) {
- $financialAccountId[$values['financial_account_id']] = CRM_Utils_Array::value(
- $values['financial_account_id'], $financialAccounts);
+ $financialAccountId[$values['financial_account_id']] = $financialAccounts[
+ $values['financial_account_id']] ?? NULL;
}
}
diff --git a/CRM/Financial/Page/FinancialTypeAccount.php b/CRM/Financial/Page/FinancialTypeAccount.php
index b01b944b72d5..9a3552cc61d7 100644
--- a/CRM/Financial/Page/FinancialTypeAccount.php
+++ b/CRM/Financial/Page/FinancialTypeAccount.php
@@ -133,12 +133,12 @@ public function browse() {
}
if (!empty($financialAccount->financial_account_type_id)) {
$optionGroupName = 'financial_account_type';
- $financialType[$dao->id]['financial_account_type'] = CRM_Utils_Array::value($financialAccount->financial_account_type_id, $financialAccountType);
+ $financialType[$dao->id]['financial_account_type'] = $financialAccountType[$financialAccount->financial_account_type_id] ?? NULL;
}
if (!empty($dao->account_relationship)) {
$optionGroupName = 'account_relationship';
- $financialType[$dao->id]['account_relationship'] = CRM_Utils_Array::value($dao->account_relationship, $accountRelationship);
+ $financialType[$dao->id]['account_relationship'] = $accountRelationship[$dao->account_relationship] ?? NULL;
}
}
// form all action links
diff --git a/CRM/Friend/BAO/Friend.php b/CRM/Friend/BAO/Friend.php
index 2d140e782656..49cb7b9d8827 100644
--- a/CRM/Friend/BAO/Friend.php
+++ b/CRM/Friend/BAO/Friend.php
@@ -157,9 +157,9 @@ public static function create(&$params) {
$transaction->commit();
// Process sending of mails
- $mailParams['title'] = CRM_Utils_Array::value('title', $params);
- $mailParams['general_link'] = CRM_Utils_Array::value('general_link', $friendParams);
- $mailParams['message'] = CRM_Utils_Array::value('suggested_message', $params);
+ $mailParams['title'] = $params['title'] ?? NULL;
+ $mailParams['general_link'] = $friendParams['general_link'] ?? NULL;
+ $mailParams['message'] = $params['suggested_message'] ?? NULL;
// Default "from email address" is default domain address.
list($_, $mailParams['email_from']) = CRM_Core_BAO_Domain::getNameAndEmail();
diff --git a/CRM/Friend/Form.php b/CRM/Friend/Form.php
index e1e03c3576b4..2af78a571a9a 100644
--- a/CRM/Friend/Form.php
+++ b/CRM/Friend/Form.php
@@ -73,8 +73,8 @@ public function preProcess() {
CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage',
$params, $values, ['title', 'campaign_id', 'is_share']
);
- $this->_title = CRM_Utils_Array::value('title', $values);
- $this->_campaignId = CRM_Utils_Array::value('campaign_id', $values);
+ $this->_title = $values['title'] ?? NULL;
+ $this->_campaignId = $values['campaign_id'] ?? NULL;
$this->_entityTable = 'civicrm_contribution_page';
if ($pcomponent == 'event') {
$this->_entityTable = 'civicrm_event';
@@ -82,7 +82,7 @@ public function preProcess() {
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_entityId, 'title');
}
else {
- $isShare = CRM_Utils_Array::value('is_share', $values);
+ $isShare = $values['is_share'] ?? NULL;
}
// Tell Form.tpl whether to include SocialNetwork.tpl for social media sharing
$this->assign('isShare', $isShare);
diff --git a/CRM/Friend/Form/Contribute.php b/CRM/Friend/Form/Contribute.php
index 67e35a989de1..56dac3ce18c2 100644
--- a/CRM/Friend/Form/Contribute.php
+++ b/CRM/Friend/Form/Contribute.php
@@ -48,11 +48,11 @@ public function setDefaultValues() {
$defaults['entity_table'] = 'civicrm_contribution_page';
$defaults['entity_id'] = $this->_id;
CRM_Friend_BAO_Friend::getValues($defaults);
- $this->_friendId = CRM_Utils_Array::value('id', $defaults);
- $defaults['tf_title'] = CRM_Utils_Array::value('title', $defaults);
- $defaults['tf_is_active'] = CRM_Utils_Array::value('is_active', $defaults);
- $defaults['tf_thankyou_title'] = CRM_Utils_Array::value('thankyou_title', $defaults);
- $defaults['tf_thankyou_text'] = CRM_Utils_Array::value('thankyou_text', $defaults);
+ $this->_friendId = $defaults['id'] ?? NULL;
+ $defaults['tf_title'] = $defaults['title'] ?? NULL;
+ $defaults['tf_is_active'] = $defaults['is_active'] ?? NULL;
+ $defaults['tf_thankyou_title'] = $defaults['thankyou_title'] ?? NULL;
+ $defaults['tf_thankyou_text'] = $defaults['thankyou_text'] ?? NULL;
}
if (!$this->_friendId) {
@@ -76,7 +76,7 @@ public function buildQuickForm() {
$defaults['entity_table'] = 'civicrm_contribution_page';
$defaults['entity_id'] = $this->_id;
CRM_Friend_BAO_Friend::getValues($defaults);
- $this->_friendId = CRM_Utils_Array::value('id', $defaults);
+ $this->_friendId = $defaults['id'] ?? NULL;
}
CRM_Friend_BAO_Friend::buildFriendForm($this);
@@ -97,8 +97,8 @@ public function postProcess() {
$formValues['entity_id'] = $this->_id;
$formValues['title'] = $formValues['tf_title'];
$formValues['is_active'] = CRM_Utils_Array::value('tf_is_active', $formValues, FALSE);
- $formValues['thankyou_title'] = CRM_Utils_Array::value('tf_thankyou_title', $formValues);
- $formValues['thankyou_text'] = CRM_Utils_Array::value('tf_thankyou_text', $formValues);
+ $formValues['thankyou_title'] = $formValues['tf_thankyou_title'] ?? NULL;
+ $formValues['thankyou_text'] = $formValues['tf_thankyou_text'] ?? NULL;
if (($this->_action & CRM_Core_Action::UPDATE) && $this->_friendId) {
$formValues['id'] = $this->_friendId;
diff --git a/CRM/Friend/Form/Event.php b/CRM/Friend/Form/Event.php
index 871ed9df58a5..a40c68e87440 100644
--- a/CRM/Friend/Form/Event.php
+++ b/CRM/Friend/Form/Event.php
@@ -49,16 +49,16 @@ public function setDefaultValues() {
$defaults['entity_id'] = $this->_id;
CRM_Friend_BAO_Friend::getValues($defaults);
if (!empty($defaults['id'])) {
- $defaults['tf_id'] = CRM_Utils_Array::value('id', $defaults);
+ $defaults['tf_id'] = $defaults['id'] ?? NULL;
$this->_friendId = $defaults['tf_id'];
// lets unset the 'id' since it conflicts with eventID (or contribID)
// CRM-12667
unset($defaults['id']);
}
- $defaults['tf_title'] = CRM_Utils_Array::value('title', $defaults);
- $defaults['tf_is_active'] = CRM_Utils_Array::value('is_active', $defaults);
- $defaults['tf_thankyou_title'] = CRM_Utils_Array::value('thankyou_title', $defaults);
- $defaults['tf_thankyou_text'] = CRM_Utils_Array::value('thankyou_text', $defaults);
+ $defaults['tf_title'] = $defaults['title'] ?? NULL;
+ $defaults['tf_is_active'] = $defaults['is_active'] ?? NULL;
+ $defaults['tf_thankyou_title'] = $defaults['thankyou_title'] ?? NULL;
+ $defaults['tf_thankyou_text'] = $defaults['thankyou_text'] ?? NULL;
}
if (!$this->_friendId) {
@@ -82,7 +82,7 @@ public function buildQuickForm() {
$defaults['entity_table'] = 'civicrm_event';
$defaults['entity_id'] = $this->_id;
CRM_Friend_BAO_Friend::getValues($defaults);
- $this->_friendId = CRM_Utils_Array::value('id', $defaults);
+ $this->_friendId = $defaults['id'] ?? NULL;
}
CRM_Friend_BAO_Friend::buildFriendForm($this);
@@ -106,8 +106,8 @@ public function postProcess() {
$formValues['entity_id'] = $this->_id;
$formValues['title'] = $formValues['tf_title'];
$formValues['is_active'] = CRM_Utils_Array::value('tf_is_active', $formValues, FALSE);
- $formValues['thankyou_title'] = CRM_Utils_Array::value('tf_thankyou_title', $formValues);
- $formValues['thankyou_text'] = CRM_Utils_Array::value('tf_thankyou_text', $formValues);
+ $formValues['thankyou_title'] = $formValues['tf_thankyou_title'] ?? NULL;
+ $formValues['thankyou_text'] = $formValues['tf_thankyou_text'] ?? NULL;
if (($this->_action & CRM_Core_Action::UPDATE) && $this->_friendId) {
$formValues['id'] = $this->_friendId;
diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php
index 58f035100de9..3d5fa8e1aca8 100644
--- a/CRM/Grant/BAO/Grant.php
+++ b/CRM/Grant/BAO/Grant.php
@@ -154,7 +154,7 @@ public static function add(&$params, &$ids) {
}
}
$grant = new CRM_Grant_DAO_Grant();
- $grant->id = CRM_Utils_Array::value('grant_id', $ids);
+ $grant->id = $ids['grant_id'] ?? NULL;
$grant->copyValues($params);
@@ -233,7 +233,7 @@ public static function create(&$params, &$ids) {
$session = CRM_Core_Session::singleton();
$id = $session->get('userID');
if (!$id) {
- $id = CRM_Utils_Array::value('contact_id', $params);
+ $id = $params['contact_id'] ?? NULL;
}
if (!empty($params['note']) || CRM_Utils_Array::value('id', CRM_Utils_Array::value('note', $ids))) {
$noteParams = [
diff --git a/CRM/Grant/StateMachine/Search.php b/CRM/Grant/StateMachine/Search.php
index 88f6c267c6cb..eade9bb5b4f5 100644
--- a/CRM/Grant/StateMachine/Search.php
+++ b/CRM/Grant/StateMachine/Search.php
@@ -71,7 +71,7 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) {
*/
public function taskName($controller, $formName = 'Search') {
// total hack, check POST vars and then session to determine stuff
- $value = CRM_Utils_Array::value('task', $_POST);
+ $value = $_POST['task'] ?? NULL;
if (!isset($value)) {
$value = $this->_controller->get('task');
}
diff --git a/CRM/Group/Page/AJAX.php b/CRM/Group/Page/AJAX.php
index 493994720d73..55428b5ef665 100644
--- a/CRM/Group/Page/AJAX.php
+++ b/CRM/Group/Page/AJAX.php
@@ -55,7 +55,7 @@ public static function getGroupList() {
// go ahead with flat hierarchy, CRM-12225
if (empty($groups)) {
$groupsAccessible = CRM_Core_PseudoConstant::group();
- $parentsOnly = CRM_Utils_Array::value('parentsOnly', $params);
+ $parentsOnly = $params['parentsOnly'] ?? NULL;
if (!empty($groupsAccessible) && $parentsOnly) {
// recompute group list with flat hierarchy
$params['parentsOnly'] = 0;
diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php
index 6767b8f3ccc3..2e05cf1d709a 100644
--- a/CRM/Logging/Differ.php
+++ b/CRM/Logging/Differ.php
@@ -231,7 +231,7 @@ private function diffsInTableForId($table, $id) {
if (!empty(${$var[$diff]})) {
$holder =& $$var;
$val = explode(CRM_Case_BAO_Case::VALUE_SEPARATOR, $holder[$diff]);
- $holder[$diff] = CRM_Utils_Array::value(1, $val);
+ $holder[$diff] = $val[1] ?? NULL;
}
}
}
@@ -306,7 +306,7 @@ public function titlesAndValuesForTable($table, $referenceDate) {
$dao = new $tableDAO();
foreach ($dao->fields() as $field) {
- $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field);
+ $titles[$table][$field['name']] = $field['title'] ?? NULL;
if ($field['type'] == CRM_Utils_Type::T_BOOLEAN) {
$values[$table][$field['name']] = ['0' => ts('false'), '1' => ts('true')];
diff --git a/CRM/Logging/ReportDetail.php b/CRM/Logging/ReportDetail.php
index d239a602da27..d5822b183d51 100644
--- a/CRM/Logging/ReportDetail.php
+++ b/CRM/Logging/ReportDetail.php
@@ -203,10 +203,10 @@ protected function convertDiffsToRows() {
) {
$froms = $tos = [];
foreach (explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($from, CRM_Core_DAO::VALUE_SEPARATOR)) as $val) {
- $froms[] = CRM_Utils_Array::value($val, $values[$field]);
+ $froms[] = $values[$field][$val] ?? NULL;
}
foreach (explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($to, CRM_Core_DAO::VALUE_SEPARATOR)) as $val) {
- $tos[] = CRM_Utils_Array::value($val, $values[$field]);
+ $tos[] = $values[$field][$val] ?? NULL;
}
$from = implode(', ', array_filter($froms));
$to = implode(', ', array_filter($tos));
diff --git a/CRM/Logging/ReportSummary.php b/CRM/Logging/ReportSummary.php
index 364474b199da..f7e93eeb24b3 100644
--- a/CRM/Logging/ReportSummary.php
+++ b/CRM/Logging/ReportSummary.php
@@ -342,7 +342,7 @@ protected function buildTemporaryTables() {
$this->addToDeveloperTab($this->temporaryTable->getCreateSql());
$this->temporaryTableName = $this->temporaryTable->getName();
- $logTypes = CRM_Utils_Array::value('log_type_value', $this->_params);
+ $logTypes = $this->_params['log_type_value'] ?? NULL;
unset($this->_params['log_type_value']);
if (empty($logTypes)) {
foreach (array_keys($this->_logTables) as $table) {
diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php
index 57fca1a971a3..98e2741e3be7 100644
--- a/CRM/Mailing/BAO/Mailing.php
+++ b/CRM/Mailing/BAO/Mailing.php
@@ -1191,7 +1191,7 @@ public function compose(
$mailParams['attachments'] = $attachments;
- $mailParams['Subject'] = CRM_Utils_Array::value('subject', $pEmails);
+ $mailParams['Subject'] = $pEmails['subject'] ?? NULL;
if (is_array($mailParams['Subject'])) {
$mailParams['Subject'] = implode('', $mailParams['Subject']);
}
@@ -1396,7 +1396,7 @@ private function getTokenData(&$token_a, $html = FALSE, &$contact, &$verp, &$url
}
}
else {
- $data = CRM_Utils_Array::value("{$type}.{$token}", $contact);
+ $data = $contact["{$type}.{$token}"] ?? NULL;
}
return $data;
}
@@ -2858,7 +2858,7 @@ public static function getContactMailingSelector(&$params) {
// format the params
$params['offset'] = ($params['page'] - 1) * $params['rp'];
$params['rowCount'] = $params['rp'];
- $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
+ $params['sort'] = $params['sortBy'] ?? NULL;
$params['caseId'] = NULL;
// get contact mailings
@@ -2951,7 +2951,7 @@ public static function getContactMailings(&$params) {
$params['version'] = 3;
$params['offset'] = ($params['page'] - 1) * $params['rp'];
$params['limit'] = $params['rp'];
- $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
+ $params['sort'] = $params['sortBy'] ?? NULL;
$result = civicrm_api('MailingContact', 'get', $params);
return $result['values'];
diff --git a/CRM/Mailing/Form/Task.php b/CRM/Mailing/Form/Task.php
index d0ba253d82e8..4a84746aaaba 100644
--- a/CRM/Mailing/Form/Task.php
+++ b/CRM/Mailing/Form/Task.php
@@ -34,7 +34,7 @@ public function preProcess() {
public static function preProcessCommon(&$form) {
$values = $form->controller->exportValues($form->get('searchFormName'));
- $form->_task = CRM_Utils_Array::value('task', $values);
+ $form->_task = $values['task'] ?? NULL;
$mailingTasks = CRM_Mailing_Task::tasks();
$form->assign('taskName', CRM_Utils_Array::value('task', $values));
diff --git a/CRM/Mailing/Page/Preview.php b/CRM/Mailing/Page/Preview.php
index 85daed2ee3a0..97a15798c4c1 100644
--- a/CRM/Mailing/Page/Preview.php
+++ b/CRM/Mailing/Page/Preview.php
@@ -44,7 +44,7 @@ public function run() {
$mailing = new CRM_Mailing_BAO_Mailing();
if (!empty($options)) {
$mailing->id = $options['mailing_id'];
- $fromEmail = CRM_Utils_Array::value('from_email', $options);
+ $fromEmail = $options['from_email'] ?? NULL;
}
$mailing->find(TRUE);
diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php
index a8265b8a67b6..98f29389f5f0 100644
--- a/CRM/Member/BAO/Membership.php
+++ b/CRM/Member/BAO/Membership.php
@@ -89,7 +89,7 @@ public static function add(&$params) {
//get the log start date.
//it is set during renewal of membership.
- $logStartDate = CRM_Utils_Array::value('log_start_date', $params);
+ $logStartDate = $params['log_start_date'] ?? NULL;
$logStartDate = ($logStartDate) ? CRM_Utils_Date::isoToMysql($logStartDate) : CRM_Utils_Date::isoToMysql($membership->start_date);
$values = self::getStatusANDTypeValues($membership->id);
@@ -131,7 +131,7 @@ public static function add(&$params) {
$targetContactID = $membership->contact_id;
if (!empty($params['is_for_organization'])) {
// @todo - deprecate is_for_organization, require modified_id
- $targetContactID = CRM_Utils_Array::value('modified_id', $params);
+ $targetContactID = $params['modified_id'] ?? NULL;
}
// add custom field values
@@ -293,7 +293,7 @@ public static function create(&$params, &$ids = []) {
if (!array_key_exists('max_related', $params) && !empty($params['membership_type_id'])) {
$membershipType = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($params['membership_type_id']);
if (isset($membershipType['relationship_type_id'])) {
- $params['max_related'] = CRM_Utils_Array::value('max_related', $membershipType);
+ $params['max_related'] = $membershipType['max_related'] ?? NULL;
}
}
}
@@ -365,7 +365,7 @@ public static function create(&$params, &$ids = []) {
foreach ($params['line_item'] as $priceSetId => $lineItems) {
foreach ($lineItems as $lineIndex => $lineItem) {
- $lineMembershipType = CRM_Utils_Array::value('membership_type_id', $lineItem);
+ $lineMembershipType = $lineItem['membership_type_id'] ?? NULL;
if (!empty($params['contribution'])) {
$params['line_item'][$priceSetId][$lineIndex]['contribution_id'] = $params['contribution']->id;
}
@@ -520,7 +520,7 @@ public static function retrieve(&$params, &$defaults) {
//get the membership status and type values.
$statusANDType = self::getStatusANDTypeValues($membership->id);
foreach (['status', 'membership_type'] as $fld) {
- $defaults[$fld] = CRM_Utils_Array::value($fld, $statusANDType[$membership->id]);
+ $defaults[$fld] = $statusANDType[$membership->id][$fld] ?? NULL;
}
if (!empty($statusANDType[$membership->id]['is_current_member'])) {
$defaults['active'] = TRUE;
@@ -929,7 +929,7 @@ public static function &importableFields($contactType = 'Individual', $status =
'column_name'
);
$value = $customFieldId ? 'custom_' . $customFieldId : $value;
- $tmpContactField[trim($value)] = CRM_Utils_Array::value(trim($value), $contactFields);
+ $tmpContactField[trim($value)] = $contactFields[trim($value)] ?? NULL;
if (!$status) {
$title = $tmpContactField[trim($value)]['title'] . " " . ts('(match to contact)');
}
@@ -1849,9 +1849,9 @@ public static function processMembership($contactID, $membershipTypeID, $is_test
$currentMembership['join_date'] = CRM_Utils_Date::customFormat($currentMembership['join_date'], $format);
foreach (['start_date', 'end_date'] as $dateType) {
- $currentMembership[$dateType] = CRM_Utils_Array::value($dateType, $formDates);
+ $currentMembership[$dateType] = $formDates[$dateType] ?? NULL;
if (empty($currentMembership[$dateType])) {
- $currentMembership[$dateType] = CRM_Utils_Array::value($dateType, $dates);
+ $currentMembership[$dateType] = $dates[$dateType] ?? NULL;
}
}
$currentMembership['is_test'] = $is_test;
@@ -1892,9 +1892,9 @@ public static function processMembership($contactID, $membershipTypeID, $is_test
$memParams = [];
$memParams['join_date'] = CRM_Utils_Date::isoToMysql($membership->join_date);
$memParams['start_date'] = CRM_Utils_Array::value('start_date', $formDates, CRM_Utils_Date::isoToMysql($membership->start_date));
- $memParams['end_date'] = CRM_Utils_Array::value('end_date', $formDates);
+ $memParams['end_date'] = $formDates['end_date'] ?? NULL;
if (empty($memParams['end_date'])) {
- $memParams['end_date'] = CRM_Utils_Array::value('end_date', $dates);
+ $memParams['end_date'] = $dates['end_date'] ?? NULL;
}
$memParams['membership_type_id'] = $membershipTypeID;
@@ -1933,9 +1933,9 @@ public static function processMembership($contactID, $membershipTypeID, $is_test
$dates = CRM_Member_BAO_MembershipType::getDatesForMembershipType($membershipTypeID, NULL, NULL, NULL, $numRenewTerms);
foreach (['join_date', 'start_date', 'end_date'] as $dateType) {
- $memParams[$dateType] = CRM_Utils_Array::value($dateType, $formDates);
+ $memParams[$dateType] = $formDates[$dateType] ?? NULL;
if (empty($memParams[$dateType])) {
- $memParams[$dateType] = CRM_Utils_Array::value($dateType, $dates);
+ $memParams[$dateType] = $dates[$dateType] ?? NULL;
}
}
@@ -1953,7 +1953,7 @@ public static function processMembership($contactID, $membershipTypeID, $is_test
$membershipTypeID,
$memParams
);
- $updateStatusId = CRM_Utils_Array::value('id', $status);
+ $updateStatusId = $status['id'] ?? NULL;
}
else {
// if IPN/Pay-Later set status to: PENDING
@@ -2268,7 +2268,7 @@ public static function updateAllMembershipStatus() {
'ignore_admin_only' => TRUE,
], TRUE
);
- $statusId = CRM_Utils_Array::value('id', $newStatus);
+ $statusId = $newStatus['id'] ?? NULL;
//process only when status change.
if ($statusId &&
@@ -2405,11 +2405,11 @@ public static function recordMembershipContribution(&$params, $ids = []) {
$config = CRM_Core_Config::singleton();
$contributionParams['currency'] = $config->defaultCurrency;
$contributionParams['receipt_date'] = (CRM_Utils_Array::value('receipt_date', $params)) ? $params['receipt_date'] : 'null';
- $contributionParams['source'] = CRM_Utils_Array::value('contribution_source', $params);
+ $contributionParams['source'] = $params['contribution_source'] ?? NULL;
$contributionParams['non_deductible_amount'] = 'null';
$contributionParams['skipCleanMoney'] = TRUE;
- $contributionParams['payment_processor'] = CRM_Utils_Array::value('payment_processor_id', $params);
- $contributionSoftParams = CRM_Utils_Array::value('soft_credit', $params);
+ $contributionParams['payment_processor'] = $params['payment_processor_id'] ?? NULL;
+ $contributionSoftParams = $params['soft_credit'] ?? NULL;
$recordContribution = [
'contact_id',
'fee_amount',
@@ -2432,7 +2432,7 @@ public static function recordMembershipContribution(&$params, $ids = []) {
'card_type_id',
];
foreach ($recordContribution as $f) {
- $contributionParams[$f] = CRM_Utils_Array::value($f, $params);
+ $contributionParams[$f] = $params[$f] ?? NULL;
}
if (!empty($params['contribution_id'])) {
@@ -2451,7 +2451,7 @@ public static function recordMembershipContribution(&$params, $ids = []) {
if (!empty($params['processPriceSet']) &&
!empty($params['lineItems'])
) {
- $contributionParams['line_item'] = CRM_Utils_Array::value('lineItems', $params, NULL);
+ $contributionParams['line_item'] = $params['lineItems'] ?? NULL;
}
$contribution = CRM_Contribute_BAO_Contribution::create($contributionParams);
@@ -2685,8 +2685,8 @@ public static function mergeMemberships($mainContactID, $otherContactID, &$sqlQu
*/
public static function updateMembershipStatus($deceasedParams, $contactType) {
$updateMembershipMsg = NULL;
- $contactId = CRM_Utils_Array::value('contact_id', $deceasedParams);
- $deceasedDate = CRM_Utils_Array::value('deceased_date', $deceasedParams);
+ $contactId = $deceasedParams['contact_id'] ?? NULL;
+ $deceasedDate = $deceasedParams['deceased_date'] ?? NULL;
// process to set membership status to deceased for both active/inactive membership
if ($contactId &&
diff --git a/CRM/Member/BAO/MembershipBlock.php b/CRM/Member/BAO/MembershipBlock.php
index f70ef619d3bc..cc11ae37b1d2 100644
--- a/CRM/Member/BAO/MembershipBlock.php
+++ b/CRM/Member/BAO/MembershipBlock.php
@@ -39,7 +39,7 @@ public static function create(&$params) {
CRM_Utils_Hook::pre($hook, 'MembershipBlock', CRM_Utils_Array::value('id', $params), $params);
$dao = new CRM_Member_DAO_MembershipBlock();
$dao->copyValues($params);
- $dao->id = CRM_Utils_Array::value('id', $params);
+ $dao->id = $params['id'] ?? NULL;
$dao->save();
CRM_Utils_Hook::post($hook, 'MembershipBlock', $dao->id, $dao);
return $dao;
diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php
index add9aacac30a..e3d1fb89667c 100644
--- a/CRM/Member/BAO/MembershipType.php
+++ b/CRM/Member/BAO/MembershipType.php
@@ -85,13 +85,13 @@ public static function add(&$params, $ids = []) {
if (isset($ids['membershipType'])) {
Civi::log()->warning('Deprecated: Passing membershipType by $ids array in CRM_Member_BAO_MembershipType::add');
}
- $params['id'] = CRM_Utils_Array::value('membershipType', $ids);
+ $params['id'] = $ids['membershipType'] ?? NULL;
}
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, 'MembershipType', CRM_Utils_Array::value('id', $params), $params);
- $membershipTypeId = CRM_Utils_Array::value('id', $params);
+ $membershipTypeId = $params['id'] ?? NULL;
if (!$membershipTypeId) {
if (!isset($params['is_active'])) {
@@ -717,15 +717,15 @@ public static function createMembershipPriceField($params, $previousID, $members
$fieldParams['is_display_amounts'] = $fieldParams['is_required'] = 0;
$fieldParams['weight'] = $fieldParams['option_weight'][1] = 1;
$fieldParams['option_label'][1] = $params['name'];
- $fieldParams['option_description'][1] = CRM_Utils_Array::value('description', $params);
+ $fieldParams['option_description'][1] = $params['description'] ?? NULL;
$fieldParams['membership_type_id'][1] = $membershipTypeId;
$fieldParams['option_amount'][1] = empty($params['minimum_fee']) ? 0 : $params['minimum_fee'];
- $fieldParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params);
+ $fieldParams['financial_type_id'] = $params['financial_type_id'] ?? NULL;
if ($previousID) {
CRM_Member_Form_MembershipType::checkPreviousPriceField($previousID, $priceSetId, $membershipTypeId, $optionsIds);
- $fieldParams['option_id'] = CRM_Utils_Array::value('option_id', $optionsIds);
+ $fieldParams['option_id'] = $optionsIds['option_id'] ?? NULL;
}
CRM_Price_BAO_PriceField::create($fieldParams);
}
@@ -759,8 +759,8 @@ public static function createMembershipPriceField($params, $previousID, $members
$optionsIds['id'] = current(CRM_Utils_Array::value('option_id', $optionsIds));
}
}
- $results['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params);
- $results['description'] = CRM_Utils_Array::value('description', $params);
+ $results['financial_type_id'] = $params['financial_type_id'] ?? NULL;
+ $results['description'] = $params['description'] ?? NULL;
CRM_Price_BAO_PriceFieldValue::add($results, $optionsIds);
}
}
@@ -801,7 +801,7 @@ public static function updateAllPriceFieldValue($membershipTypeId, $params) {
$updateParams['visibility_id'] = CRM_Price_BAO_PriceField::getVisibilityOptionID(strtolower($params['visibility']));
}
else {
- $updateParams[$value] = CRM_Utils_Array::value($key, $params);
+ $updateParams[$value] = $params[$key] ?? NULL;
}
}
CRM_Price_BAO_PriceFieldValue::add($updateParams);
diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php
index 1408396dafdd..dc8ca97f16d6 100644
--- a/CRM/Member/Form.php
+++ b/CRM/Member/Form.php
@@ -430,7 +430,7 @@ protected function ensurePriceParamsAreSet(&$formValues) {
* @return array
*/
protected static function getPriceSetDetails($params) {
- $priceSetID = CRM_Utils_Array::value('price_set_id', $params);
+ $priceSetID = $params['price_set_id'] ?? NULL;
if ($priceSetID) {
return CRM_Price_BAO_PriceSet::getSetDetail($priceSetID);
}
@@ -450,7 +450,7 @@ protected static function getPriceSetDetails($params) {
* @return int
*/
protected static function getPriceSetID($params) {
- $priceSetID = CRM_Utils_Array::value('price_set_id', $params);
+ $priceSetID = $params['price_set_id'] ?? NULL;
if (!$priceSetID) {
$priceSetDetails = self::getPriceSetDetails($params);
return key($priceSetDetails);
diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php
index bf26de3d4eef..be987d359118 100644
--- a/CRM/Member/Form/Membership.php
+++ b/CRM/Member/Form/Membership.php
@@ -201,7 +201,7 @@ public function preProcess() {
parent::preProcess();
// get price set id.
- $this->_priceSetId = CRM_Utils_Array::value('priceSetId', $_GET);
+ $this->_priceSetId = $_GET['priceSetId'] ?? NULL;
$this->set('priceSetId', $this->_priceSetId);
$this->assign('priceSetId', $this->_priceSetId);
@@ -227,7 +227,7 @@ public function preProcess() {
$memberorgs = CRM_Member_BAO_MembershipType::getMemberOfContactByMemTypes($cMemTypes);
$mems_by_org = [];
foreach ($contactMemberships as $mem) {
- $mem['member_of_contact_id'] = CRM_Utils_Array::value($mem['membership_type_id'], $memberorgs);
+ $mem['member_of_contact_id'] = $memberorgs[$mem['membership_type_id']] ?? NULL;
if (!empty($mem['membership_end_date'])) {
$mem['membership_end_date'] = CRM_Utils_Date::customFormat($mem['membership_end_date']);
}
@@ -487,7 +487,7 @@ public function buildQuickForm() {
continue;
}
else {
- $memberOfContactId = CRM_Utils_Array::value('member_of_contact_id', $values);
+ $memberOfContactId = $values['member_of_contact_id'] ?? NULL;
if (empty($selMemTypeOrg[$memberOfContactId])) {
$selMemTypeOrg[$memberOfContactId] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
$memberOfContactId,
@@ -498,10 +498,10 @@ public function buildQuickForm() {
$selOrgMemType[$memberOfContactId][0] = ts('- select -');
}
if (empty($selOrgMemType[$memberOfContactId][$key])) {
- $selOrgMemType[$memberOfContactId][$key] = CRM_Utils_Array::value('name', $values);
+ $selOrgMemType[$memberOfContactId][$key] = $values['name'] ?? NULL;
}
}
- $totalAmount = CRM_Utils_Array::value('minimum_fee', $values);
+ $totalAmount = $values['minimum_fee'] ?? NULL;
//CRM-18827 - override the default value if total_amount is submitted
if (!empty($this->_submitValues['total_amount'])) {
$totalAmount = $this->_submitValues['total_amount'];
@@ -710,7 +710,7 @@ public static function formRule($params, $files, $self) {
if (empty($params['membership_type_id'][1])) {
$errors['membership_type_id'] = ts('Please select a membership type.');
}
- $numterms = CRM_Utils_Array::value('num_terms', $params);
+ $numterms = $params['num_terms'] ?? NULL;
if ($numterms && intval($numterms) != $numterms) {
$errors['num_terms'] = ts('Please enter an integer for the number of terms.');
}
@@ -947,7 +947,7 @@ private function convertIsOverrideValue() {
*/
public static function emailReceipt(&$form, &$formValues, &$membership, $customValues = NULL) {
// retrieve 'from email id' for acknowledgement
- $receiptFrom = CRM_Utils_Array::value('from_email_address', $formValues);
+ $receiptFrom = $formValues['from_email_address'] ?? NULL;
// @todo figure out how much of the stuff below is genuinely shared with the batch form & a logical shared place.
if (!empty($formValues['payment_instrument_id'])) {
@@ -1030,7 +1030,7 @@ public static function emailReceipt(&$form, &$formValues, &$membership, $customV
$taxAmt = $template->get_template_vars('dataArray');
$eventTaxAmt = $template->get_template_vars('totalTaxAmount');
$prefixValue = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
+ $invoicing = $prefixValue['invoicing'] ?? NULL;
if ((!empty($taxAmt) || isset($eventTaxAmt)) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
$isEmailPdf = TRUE;
}
@@ -1149,7 +1149,7 @@ public function submit() {
if (!empty($formValues['tax_amount'])) {
$params['tax_amount'] = $formValues['tax_amount'];
}
- $params['total_amount'] = CRM_Utils_Array::value('amount', $formValues);
+ $params['total_amount'] = $formValues['amount'] ?? NULL;
if (!empty($lineItem[$this->_priceSetId])) {
foreach ($lineItem[$this->_priceSetId] as &$li) {
if (!empty($li['membership_type_id'])) {
@@ -1161,7 +1161,7 @@ public function submit() {
///CRM-11529 for quick config backoffice transactions
//when financial_type_id is passed in form, update the
//lineitems with the financial type selected in form
- $submittedFinancialType = CRM_Utils_Array::value('financial_type_id', $formValues);
+ $submittedFinancialType = $formValues['financial_type_id'] ?? NULL;
if ($isQuickConfig && $submittedFinancialType) {
$li['financial_type_id'] = $submittedFinancialType;
}
@@ -1179,7 +1179,7 @@ public function submit() {
];
foreach ($fields as $f) {
- $params[$f] = CRM_Utils_Array::value($f, $formValues);
+ $params[$f] = $formValues[$f] ?? NULL;
}
// fix for CRM-3724
@@ -1214,9 +1214,9 @@ public function submit() {
foreach ($calcDates as $memType => $calcDate) {
foreach (array_keys($dateTypes) as $d) {
//first give priority to form values then calDates.
- $date = CRM_Utils_Array::value($d, $formValues);
+ $date = $formValues[$d] ?? NULL;
if (!$date) {
- $date = CRM_Utils_Array::value($d, $calcDate);
+ $date = $calcDate[$d] ?? NULL;
}
$membershipTypeValues[$memType][$d] = CRM_Utils_Date::processDate($date);
@@ -1226,7 +1226,7 @@ public function submit() {
foreach ($this->_memTypeSelected as $memType) {
if (array_key_exists('max_related', $formValues)) {
// max related memberships - take from form or inherit from membership type
- $membershipTypeValues[$memType]['max_related'] = CRM_Utils_Array::value('max_related', $formValues);
+ $membershipTypeValues[$memType]['max_related'] = $formValues['max_related'] ?? NULL;
}
$membershipTypeValues[$memType]['custom'] = CRM_Core_BAO_CustomField::postProcess($formValues,
$this->_id,
@@ -1268,7 +1268,7 @@ public function submit() {
];
foreach ($recordContribution as $f) {
- $params[$f] = CRM_Utils_Array::value($f, $formValues);
+ $params[$f] = $formValues[$f] ?? NULL;
}
if (!$this->_onlinePendingContributionId) {
@@ -1294,7 +1294,7 @@ public function submit() {
}
if (!empty($formValues['send_receipt'])) {
- $params['receipt_date'] = CRM_Utils_Array::value('receive_date', $formValues);
+ $params['receipt_date'] = $formValues['receive_date'] ?? NULL;
}
//insert financial type name in receipt.
@@ -1313,8 +1313,8 @@ public function submit() {
$params['total_amount'] = CRM_Utils_Array::value('total_amount', $formValues, 0);
//CRM-20264 : Store CC type and number (last 4 digit) during backoffice or online payment
- $params['card_type_id'] = CRM_Utils_Array::value('card_type_id', $this->_params);
- $params['pan_truncation'] = CRM_Utils_Array::value('pan_truncation', $this->_params);
+ $params['card_type_id'] = $this->_params['card_type_id'] ?? NULL;
+ $params['pan_truncation'] = $this->_params['pan_truncation'] ?? NULL;
if (!$isQuickConfig) {
$params['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet',
@@ -1323,7 +1323,7 @@ public function submit() {
);
}
else {
- $params['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $formValues);
+ $params['financial_type_id'] = $formValues['financial_type_id'] ?? NULL;
}
//get the payment processor id as per mode. Try removing in favour of beginPostProcess.
@@ -1455,7 +1455,7 @@ public function submit() {
[1 => $membershipType, 2 => $userName]
);
$params['source'] = $formValues['source'] ? $formValues['source'] : $params['contribution_source'];
- $params['trxn_id'] = CRM_Utils_Array::value('trxn_id', $result);
+ $params['trxn_id'] = $result['trxn_id'] ?? NULL;
$params['is_test'] = ($this->_mode === 'live') ? 0 : 1;
if (!empty($formValues['send_receipt'])) {
$params['receipt_date'] = $now;
@@ -1496,7 +1496,7 @@ public function submit() {
// appropriate as part of our 2-step always create the pending contribution & then finally add the payment
// process -
// @see http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=261062657#Payments&AccountsRoadmap-Movetowardsalwaysusinga2-steppaymentprocess
- $membershipParams['contribution_status_id'] = CRM_Utils_Array::value('payment_status_id', $result);
+ $membershipParams['contribution_status_id'] = $result['payment_status_id'] ?? NULL;
if (!empty($paymentParams['is_recur'])) {
// The earlier process created the line items (although we want to get rid of the earlier one in favour
// of a single path!
@@ -1505,7 +1505,7 @@ public function submit() {
$membershipParams['payment_instrument_id'] = $paymentInstrumentID;
// @todo stop passing $ids (membership and userId only are set above)
$membership = CRM_Member_BAO_Membership::create($membershipParams, $ids);
- $params['contribution'] = CRM_Utils_Array::value('contribution', $membershipParams);
+ $params['contribution'] = $membershipParams['contribution'] ?? NULL;
unset($params['lineItems']);
$this->_membershipIDs[] = $membership->id;
$createdMemberships[$memType] = $membership;
@@ -1602,7 +1602,7 @@ public function submit() {
}
// @todo stop passing $ids (membership and userId only are set above)
$membership = CRM_Member_BAO_Membership::create($membershipParams, $ids);
- $params['contribution'] = CRM_Utils_Array::value('contribution', $membershipParams);
+ $params['contribution'] = $membershipParams['contribution'] ?? NULL;
unset($params['lineItems']);
// skip line item creation for next interation since line item(s) are already created.
$params['skipLineItem'] = TRUE;
@@ -1613,7 +1613,7 @@ public function submit() {
}
}
}
- $isRecur = CRM_Utils_Array::value('is_recur', $params);
+ $isRecur = $params['is_recur'] ?? NULL;
if (($this->_action & CRM_Core_Action::UPDATE)) {
$this->addStatusMessage($this->getStatusMessageForUpdate($membership, $endDate));
}
@@ -1624,7 +1624,7 @@ public function submit() {
if (!empty($lineItem[$this->_priceSetId])) {
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$taxAmount = FALSE;
$totalTaxAmount = 0;
foreach ($lineItem[$this->_priceSetId] as & $priceFieldOp) {
@@ -1648,7 +1648,7 @@ public function submit() {
$dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value);
}
else {
- $dataArray[$value['tax_rate']] = CRM_Utils_Array::value('tax_amount', $value);
+ $dataArray[$value['tax_rate']] = $value['tax_amount'] ?? NULL;
}
}
}
@@ -1857,7 +1857,7 @@ protected function getStatusMessageForCreate($endDate, $membershipTypes, $create
//get the end date from calculated dates.
if (!$memEndDate && !$isRecur) {
- $memEndDate = CRM_Utils_Array::value('end_date', $calcDates[$memType]);
+ $memEndDate = $calcDates[$memType]['end_date'] ?? NULL;
}
if ($memEndDate && $memEndDate !== 'null') {
diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php
index 90d5a63a2e83..9f6b4ea0119c 100644
--- a/CRM/Member/Form/MembershipBlock.php
+++ b/CRM/Member/Form/MembershipBlock.php
@@ -337,7 +337,7 @@ public function postProcess() {
if (is_array($params['membership_type'])) {
foreach ($params['membership_type'] as $k => $v) {
if ($v) {
- $membershipTypes[$k] = CRM_Utils_Array::value("auto_renew_$k", $params);
+ $membershipTypes[$k] = $params["auto_renew_$k"] ?? NULL;
}
}
}
@@ -347,7 +347,7 @@ public function postProcess() {
}
// check for price set.
- $priceSetID = CRM_Utils_Array::value('member_price_set_id', $params);
+ $priceSetID = $params['member_price_set_id'] ?? NULL;
if (!empty($params['member_is_active']) && is_array($membershipTypes) && !$priceSetID) {
$usedPriceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 2);
if (empty($params['mem_price_field_id']) && !$usedPriceSetId) {
@@ -365,21 +365,21 @@ public function postProcess() {
}
$setParams['is_quick_config'] = 1;
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember');
- $setParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_values);
+ $setParams['financial_type_id'] = $this->_values['financial_type_id'] ?? NULL;
$priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
$fieldParams['price_set_id'] = $priceSet->id;
}
elseif ($usedPriceSetId) {
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember');
- $setParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_values);
+ $setParams['financial_type_id'] = $this->_values['financial_type_id'] ?? NULL;
$setParams['id'] = $usedPriceSetId;
$priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
$fieldParams['price_set_id'] = $priceSet->id;
}
else {
- $fieldParams['id'] = CRM_Utils_Array::value('mem_price_field_id', $params);
+ $fieldParams['id'] = $params['mem_price_field_id'] ?? NULL;
$priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', CRM_Utils_Array::value('mem_price_field_id', $params), 'price_set_id');
}
$editedFieldParams = [
@@ -396,7 +396,7 @@ public function postProcess() {
$fieldParams['weight'] = 1;
}
else {
- $fieldParams['id'] = CRM_Utils_Array::value('id', $editedResults);
+ $fieldParams['id'] = $editedResults['id'] ?? NULL;
}
$fieldParams['label'] = !empty($params['membership_type_label']) ? $params['membership_type_label'] : ts('Membership');
@@ -416,12 +416,12 @@ public function postProcess() {
unset($options[$priceFieldID]);
}
$membetype = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($memType);
- $fieldParams['option_label'][$rowCount] = CRM_Utils_Array::value('name', $membetype);
+ $fieldParams['option_label'][$rowCount] = $membetype['name'] ?? NULL;
$fieldParams['option_amount'][$rowCount] = CRM_Utils_Array::value('minimum_fee', $membetype, 0);
- $fieldParams['option_weight'][$rowCount] = CRM_Utils_Array::value('weight', $membetype);
- $fieldParams['option_description'][$rowCount] = CRM_Utils_Array::value('description', $membetype);
- $fieldParams['default_option'] = CRM_Utils_Array::value('membership_type_default', $params);
- $fieldParams['option_financial_type_id'][$rowCount] = CRM_Utils_Array::value('financial_type_id', $membetype);
+ $fieldParams['option_weight'][$rowCount] = $membetype['weight'] ?? NULL;
+ $fieldParams['option_description'][$rowCount] = $membetype['description'] ?? NULL;
+ $fieldParams['default_option'] = $params['membership_type_default'] ?? NULL;
+ $fieldParams['option_financial_type_id'][$rowCount] = $membetype['financial_type_id'] ?? NULL;
$fieldParams['membership_type_id'][$rowCount] = $memType;
// [$rowCount] = $membetype[''];
diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php
index 9b4f1d749125..db5b73149f97 100644
--- a/CRM/Member/Form/MembershipRenewal.php
+++ b/CRM/Member/Form/MembershipRenewal.php
@@ -214,7 +214,7 @@ public function setDefaultValues() {
$scTypes = CRM_Core_OptionGroup::values("soft_credit_type");
$defaults['soft_credit_type_id'] = CRM_Utils_Array::value(ts('Gift'), array_flip($scTypes));
- $renewalDate = CRM_Utils_Array::value('renewal_date', $defaults);
+ $renewalDate = $defaults['renewal_date'] ?? NULL;
$this->assign('renewalDate', $renewalDate);
$this->assign('member_is_test', CRM_Utils_Array::value('member_is_test', $defaults));
@@ -259,7 +259,7 @@ public function buildQuickForm() {
continue;
}
else {
- $memberOfContactId = CRM_Utils_Array::value('member_of_contact_id', $values);
+ $memberOfContactId = $values['member_of_contact_id'] ?? NULL;
if (empty($selMemTypeOrg[$memberOfContactId])) {
$selMemTypeOrg[$memberOfContactId] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
$memberOfContactId,
@@ -270,13 +270,13 @@ public function buildQuickForm() {
$selOrgMemType[$memberOfContactId][0] = ts('- select -');
}
if (empty($selOrgMemType[$memberOfContactId][$key])) {
- $selOrgMemType[$memberOfContactId][$key] = CRM_Utils_Array::value('name', $values);
+ $selOrgMemType[$memberOfContactId][$key] = $values['name'] ?? NULL;
}
}
//CRM-16950
$taxAmount = NULL;
- $totalAmount = CRM_Utils_Array::value('minimum_fee', $values);
+ $totalAmount = $values['minimum_fee'] ?? NULL;
// @todo - feels a bug - we use taxRate from the form default rather than from the specified type?!?
if ($this->getTaxRateForFinancialType($values['financial_type_id'])) {
$taxAmount = ($taxRate / 100) * CRM_Utils_Array::value('minimum_fee', $values);
diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php
index 152680491f44..096aa786e084 100644
--- a/CRM/Member/Form/MembershipType.php
+++ b/CRM/Member/Form/MembershipType.php
@@ -502,7 +502,7 @@ public static function checkPreviousPriceField($previousID, $priceSetId, $member
];
$editedResults = [];
CRM_Price_BAO_PriceFieldValue::retrieve($editedFieldParams, $editedResults);
- $optionsIds['option_id'][1] = CRM_Utils_Array::value('id', $editedResults);
+ $optionsIds['option_id'][1] = $editedResults['id'] ?? NULL;
}
}
}
diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php
index 04c7bbb0c7b9..0d25822fee23 100644
--- a/CRM/Member/Form/Task/Batch.php
+++ b/CRM/Member/Form/Task/Batch.php
@@ -133,7 +133,7 @@ public function buildQuickForm() {
$typeId = CRM_Core_DAO::getFieldValue("CRM_Member_DAO_Membership", $memberId, 'membership_type_id');
foreach ($this->_fields as $name => $field) {
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {
- $customValue = CRM_Utils_Array::value($customFieldID, $customFields);
+ $customValue = $customFields[$customFieldID] ?? NULL;
$entityColumnValue = [];
if (!empty($customValue['extends_entity_column_value'])) {
$entityColumnValue = explode(CRM_Core_DAO::VALUE_SEPARATOR,
diff --git a/CRM/Member/Form/Task/Label.php b/CRM/Member/Form/Task/Label.php
index 2068aeec0276..df6aa2d3b0aa 100644
--- a/CRM/Member/Form/Task/Label.php
+++ b/CRM/Member/Form/Task/Label.php
@@ -54,7 +54,7 @@ public function buildQuickForm() {
public function setDefaultValues() {
$defaults = [];
$format = CRM_Core_BAO_LabelFormat::getDefaultValues();
- $defaults['label_name'] = CRM_Utils_Array::value('name', $format);
+ $defaults['label_name'] = $format['name'] ?? NULL;
$defaults['merge_same_address'] = 0;
$defaults['merge_same_household'] = 0;
$defaults['do_not_mail'] = 1;
@@ -70,11 +70,11 @@ public function setDefaultValues() {
public function postProcess() {
$formValues = $this->controller->exportValues($this->_name);
$locationTypeID = $formValues['location_type_id'];
- $respectDoNotMail = CRM_Utils_Array::value('do_not_mail', $formValues);
+ $respectDoNotMail = $formValues['do_not_mail'] ?? NULL;
$labelName = $formValues['label_name'];
- $mergeSameAddress = CRM_Utils_Array::value('merge_same_address', $formValues);
- $mergeSameHousehold = CRM_Utils_Array::value('merge_same_household', $formValues);
- $isPerMembership = CRM_Utils_Array::value('per_membership', $formValues);
+ $mergeSameAddress = $formValues['merge_same_address'] ?? NULL;
+ $mergeSameHousehold = $formValues['merge_same_household'] ?? NULL;
+ $isPerMembership = $formValues['per_membership'] ?? NULL;
if ($isPerMembership && ($mergeSameAddress || $mergeSameHousehold)) {
// this shouldn't happen - perhaps is could if JS is disabled
CRM_Core_Session::setStatus(ts('As you are printing one label per membership your merge settings are being ignored'));
diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php
index a991c85bcfef..57728384f8af 100644
--- a/CRM/Member/Import/Form/MapField.php
+++ b/CRM/Member/Import/Form/MapField.php
@@ -113,9 +113,9 @@ public function buildQuickForm() {
$mappingName = $mappingName[1];
$mappingContactType = $mappingContactType[1];
- $mappingLocation = CRM_Utils_Array::value('1', $mappingLocation);
- $mappingPhoneType = CRM_Utils_Array::value('1', $mappingPhoneType);
- $mappingRelation = CRM_Utils_Array::value('1', $mappingRelation);
+ $mappingLocation = $mappingLocation['1'] ?? NULL;
+ $mappingPhoneType = $mappingPhoneType['1'] ?? NULL;
+ $mappingRelation = $mappingRelation['1'] ?? NULL;
//mapping is to be loaded from database
@@ -361,7 +361,7 @@ public static function formRule($fields, $files, $self) {
}
if (!empty($fields['saveMapping'])) {
- $nameField = CRM_Utils_Array::value('saveMappingName', $fields);
+ $nameField = $fields['saveMappingName'] ?? NULL;
if (empty($nameField)) {
$errors['saveMappingName'] = ts('Name is required to save Import Mapping');
}
diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php
index fcf45519cda3..0a1bd220ab4e 100644
--- a/CRM/Member/Import/Parser/Membership.php
+++ b/CRM/Member/Import/Parser/Membership.php
@@ -524,7 +524,7 @@ public function import($onDuplicate, &$values) {
$formatted
);
if (empty($formatted['status_id'])) {
- $formatted['status_id'] = CRM_Utils_Array::value('id', $calcStatus);
+ $formatted['status_id'] = $calcStatus['id'] ?? NULL;
}
elseif (empty($formatted['member_is_override'])) {
if (empty($calcStatus)) {
diff --git a/CRM/Member/Page/AJAX.php b/CRM/Member/Page/AJAX.php
index 4f44feaed876..85dd65416675 100644
--- a/CRM/Member/Page/AJAX.php
+++ b/CRM/Member/Page/AJAX.php
@@ -50,7 +50,7 @@ public static function getMemberTypeDefaults() {
// fix the display of the monetary value, CRM-4038
$details['total_amount'] = CRM_Utils_Money::format($details['total_amount'], NULL, '%a');
$options = CRM_Core_SelectValues::memberAutoRenew();
- $details['auto_renew'] = CRM_Utils_Array::value('auto_renew', $options[$details]);
+ $details['auto_renew'] = $options[$details]['auto_renew'] ?? NULL;
CRM_Utils_JSON::output($details);
}
diff --git a/CRM/Member/Page/DashBoard.php b/CRM/Member/Page/DashBoard.php
index 66aeba71ae05..76e4d5806e90 100644
--- a/CRM/Member/Page/DashBoard.php
+++ b/CRM/Member/Page/DashBoard.php
@@ -51,7 +51,7 @@ public function preProcess() {
$isCurrentMonth = 0;
// You can force the dashboard to display based upon a certain date
- $ym = CRM_Utils_Array::value('date', $_GET);
+ $ym = $_GET['date'] ?? NULL;
if ($ym) {
if (preg_match('/^\d{6}$/', $ym) == 0 ||
diff --git a/CRM/Member/Page/MembershipType.php b/CRM/Member/Page/MembershipType.php
index 6f2810aae014..1012cd28c64b 100644
--- a/CRM/Member/Page/MembershipType.php
+++ b/CRM/Member/Page/MembershipType.php
@@ -125,7 +125,7 @@ public function browse() {
$value, $relationshipName
);
}
- $membershipType[$dao->id]['maxRelated'] = CRM_Utils_Array::value('max_related', $membershipType[$dao->id]);
+ $membershipType[$dao->id]['maxRelated'] = $membershipType[$dao->id]['max_related'] ?? NULL;
}
if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && !CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($dao->financial_type_id))) {
unset($links[CRM_Core_Action::UPDATE], $links[CRM_Core_Action::ENABLE], $links[CRM_Core_Action::DISABLE]);
diff --git a/CRM/Member/Page/RecurringContributions.php b/CRM/Member/Page/RecurringContributions.php
index 546350457f15..aac582c3892e 100644
--- a/CRM/Member/Page/RecurringContributions.php
+++ b/CRM/Member/Page/RecurringContributions.php
@@ -96,7 +96,7 @@ private function getRecurContributions($membershipID) {
$recurringContributions[$recurringContributionID]['id'] = $recurringContributionID;
$recurringContributions[$recurringContributionID]['contactId'] = $contactID;
- $recurringContributions[$recurringContributionID]['contribution_status'] = CRM_Utils_Array::value($contributionStatusID, $contributionStatuses);
+ $recurringContributions[$recurringContributionID]['contribution_status'] = $contributionStatuses[$contributionStatusID] ?? NULL;
$this->setActionsForRecurringContribution($recurringContributionID, $recurringContributions[$recurringContributionID]);
}
diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php
index fb937edd24dc..8301a964a757 100644
--- a/CRM/Member/Page/Tab.php
+++ b/CRM/Member/Page/Tab.php
@@ -69,12 +69,12 @@ public function browse() {
CRM_Core_DAO::storeValues($dao, $membership[$dao->id]);
//carry campaign.
- $membership[$dao->id]['campaign'] = CRM_Utils_Array::value($dao->campaign_id, $allCampaigns);
+ $membership[$dao->id]['campaign'] = $allCampaigns[$dao->campaign_id] ?? NULL;
//get the membership status and type values.
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id);
foreach (['status', 'membership_type'] as $fld) {
- $membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
+ $membership[$dao->id][$fld] = $statusANDType[$dao->id][$fld] ?? NULL;
}
if (!empty($statusANDType[$dao->id]['is_current_member'])) {
$membership[$dao->id]['active'] = TRUE;
@@ -162,7 +162,7 @@ public function browse() {
LEFT JOIN civicrm_contact ct ON ct.id = m.contact_id
WHERE m.owner_membership_id = {$dao->id} AND m.is_test = 0 AND ms.is_current_member = 1 AND ct.is_deleted = 0";
$num_related = CRM_Core_DAO::singleValueQuery($query);
- $max_related = CRM_Utils_Array::value('max_related', $membership[$dao->id]);
+ $max_related = $membership[$dao->id]['max_related'] ?? NULL;
$membership[$dao->id]['related_count'] = ($max_related == '' ? ts('%1 created', [1 => $num_related]) : ts('%1 out of %2', [
1 => $num_related,
2 => $max_related,
@@ -181,7 +181,7 @@ public function browse() {
'limit' => 0,
],
]);
- $membershipTypes = CRM_Utils_Array::value('values', $membershipTypesResult, NULL);
+ $membershipTypes = $membershipTypesResult['values'] ?? NULL;
foreach ($membershipTypes as $key => $value) {
$membershipTypes[$key]['action'] = CRM_Core_Action::formLink(self::membershipTypeslinks(),
diff --git a/CRM/Member/Page/UserDashboard.php b/CRM/Member/Page/UserDashboard.php
index 95759377f519..7ac24c15ff92 100644
--- a/CRM/Member/Page/UserDashboard.php
+++ b/CRM/Member/Page/UserDashboard.php
@@ -43,7 +43,7 @@ public function listMemberships() {
'status',
'membership_type',
] as $fld) {
- $membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
+ $membership[$dao->id][$fld] = $statusANDType[$dao->id][$fld] ?? NULL;
}
if (!empty($statusANDType[$dao->id]['is_current_member'])) {
$membership[$dao->id]['active'] = TRUE;
diff --git a/CRM/Member/PseudoConstant.php b/CRM/Member/PseudoConstant.php
index dad1efc157aa..455ff98c9e09 100644
--- a/CRM/Member/PseudoConstant.php
+++ b/CRM/Member/PseudoConstant.php
@@ -96,7 +96,7 @@ public static function &membershipStatus($id = NULL, $cond = NULL, $column = 'na
$value = NULL;
if ($id) {
- $value = CRM_Utils_Array::value($id, self::$membershipStatus[$cacheKey]);
+ $value = self::$membershipStatus[$cacheKey][$id] ?? NULL;
}
else {
$value = self::$membershipStatus[$cacheKey];
diff --git a/CRM/Member/Selector/Search.php b/CRM/Member/Selector/Search.php
index eed017706da9..45ccf5099270 100644
--- a/CRM/Member/Selector/Search.php
+++ b/CRM/Member/Selector/Search.php
@@ -357,7 +357,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
}
//carry campaign on selectors.
- $row['campaign'] = CRM_Utils_Array::value($result->member_campaign_id, $allCampaigns);
+ $row['campaign'] = $allCampaigns[$result->member_campaign_id] ?? NULL;
$row['campaign_id'] = $result->member_campaign_id;
if (!empty($row['member_is_test'])) {
diff --git a/CRM/Member/StateMachine/Search.php b/CRM/Member/StateMachine/Search.php
index 9f9a9514935e..8d3ea7a3c3e1 100644
--- a/CRM/Member/StateMachine/Search.php
+++ b/CRM/Member/StateMachine/Search.php
@@ -69,7 +69,7 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) {
*/
public function taskName($controller, $formName = 'Search') {
// total hack, check POST vars and then session to determine stuff
- $value = CRM_Utils_Array::value('task', $_POST);
+ $value = $_POST['task'] ?? NULL;
if (!isset($value)) {
$value = $this->_controller->get('task');
}
diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php
index 6b4660548e3e..3817a3e30d89 100644
--- a/CRM/PCP/BAO/PCP.php
+++ b/CRM/PCP/BAO/PCP.php
@@ -138,7 +138,7 @@ public static function getPcpDashboardInfo($contactId) {
$action = CRM_Core_Action::formLink($pcpLink, $mask, $replace, ts('more'),
FALSE, 'pcp.dashboard.active', 'PCP', $pcpInfoDao->id);
$component = $pcpInfoDao->page_type;
- $pageTitle = CRM_Utils_Array::value($pcpInfoDao->page_id, $$component);
+ $pageTitle = $$component[$pcpInfoDao->page_id] ?? NULL;
$pcpInfo[] = [
'pageTitle' => $pageTitle,
diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php
index 44d7d872f8ce..a3037bcd35c6 100644
--- a/CRM/PCP/Form/Campaign.php
+++ b/CRM/PCP/Form/Campaign.php
@@ -68,8 +68,8 @@ public function setDefaultValues() {
$defaults['goal_amount'] = CRM_Utils_Money::format($defaults['goal_amount'], NULL, '%a');
}
- $defaults['pcp_title'] = CRM_Utils_Array::value('title', $defaults);
- $defaults['pcp_intro_text'] = CRM_Utils_Array::value('intro_text', $defaults);
+ $defaults['pcp_title'] = $defaults['title'] ?? NULL;
+ $defaults['pcp_intro_text'] = $defaults['intro_text'] ?? NULL;
}
if ($this->get('action') & CRM_Core_Action::ADD) {
@@ -79,8 +79,8 @@ public function setDefaultValues() {
$defaults['is_notify'] = 1;
}
- $this->_contactID = CRM_Utils_Array::value('contact_id', $defaults);
- $this->_contriPageId = CRM_Utils_Array::value('page_id', $defaults);
+ $this->_contactID = $defaults['contact_id'] ?? NULL;
+ $this->_contriPageId = $defaults['page_id'] ?? NULL;
return $defaults;
}
diff --git a/CRM/PCP/Form/Contribute.php b/CRM/PCP/Form/Contribute.php
index 124bbcf1fee0..bbe080e1e46b 100644
--- a/CRM/PCP/Form/Contribute.php
+++ b/CRM/PCP/Form/Contribute.php
@@ -47,7 +47,7 @@ public function setDefaultValues() {
if (isset($this->_id)) {
$params = ['entity_id' => $this->_id, 'entity_table' => 'civicrm_contribution_page'];
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $params, $defaults);
- $defaults['pcp_active'] = CRM_Utils_Array::value('is_active', $defaults);
+ $defaults['pcp_active'] = $defaults['is_active'] ?? NULL;
// Assign contribution page ID to pageId for referencing in PCP.hlp - since $id is overwritten there. dgg
$this->assign('pageId', $this->_id);
}
diff --git a/CRM/PCP/Form/Event.php b/CRM/PCP/Form/Event.php
index 5ea57f4686ee..004282d38358 100644
--- a/CRM/PCP/Form/Event.php
+++ b/CRM/PCP/Form/Event.php
@@ -48,7 +48,7 @@ public function setDefaultValues() {
$params = ['entity_id' => $this->_id, 'entity_table' => 'civicrm_event'];
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $params, $defaults);
- $defaults['pcp_active'] = CRM_Utils_Array::value('is_active', $defaults);
+ $defaults['pcp_active'] = $defaults['is_active'] ?? NULL;
// Assign contribution page ID to pageId for referencing in PCP.hlp - since $id is overwritten there. dgg
$this->assign('pageId', $this->_id);
}
diff --git a/CRM/PCP/Form/PCP.php b/CRM/PCP/Form/PCP.php
index cb7482a3ffb3..d9fbcb7c6975 100644
--- a/CRM/PCP/Form/PCP.php
+++ b/CRM/PCP/Form/PCP.php
@@ -43,8 +43,8 @@ public function preProcess() {
}
if (!$this->_action) {
- $this->_action = CRM_Utils_Array::value('action', $_GET);
- $this->_id = CRM_Utils_Array::value('id', $_GET);
+ $this->_action = $_GET['action'] ?? NULL;
+ $this->_id = $_GET['id'] ?? NULL;
}
else {
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
diff --git a/CRM/PCP/Page/PCPInfo.php b/CRM/PCP/Page/PCPInfo.php
index 8468710369d7..de831f3b2479 100644
--- a/CRM/PCP/Page/PCPInfo.php
+++ b/CRM/PCP/Page/PCPInfo.php
@@ -139,7 +139,7 @@ public function run() {
if ($pcpInfo['contact_id'] == $session->get('userID')) {
$owner = $pageInfo;
- $owner['status'] = CRM_Utils_Array::value($pcpInfo['status_id'], $pcpStatus);
+ $owner['status'] = $pcpStatus[$pcpInfo['status_id']] ?? NULL;
$this->assign('owner', $owner);
diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php
index fbe7a757d0fb..4fdc3ec5f656 100644
--- a/CRM/Pledge/BAO/Pledge.php
+++ b/CRM/Pledge/BAO/Pledge.php
@@ -157,7 +157,7 @@ public static function create(&$params) {
}
}
}
- $paymentParams['status_id'] = CRM_Utils_Array::value('status_id', $params);
+ $paymentParams['status_id'] = $params['status_id'] ?? NULL;
$pledge = self::add($params);
if (is_a($pledge, 'CRM_Core_Error')) {
@@ -195,7 +195,7 @@ public static function create(&$params) {
'actual_amount',
);
foreach ($paymentKeys as $key) {
- $paymentParams[$key] = CRM_Utils_Array::value($key, $params, NULL);
+ $paymentParams[$key] = $params[$key] ?? NULL;
}
CRM_Pledge_BAO_PledgePayment::create($paymentParams);
}
@@ -626,8 +626,8 @@ public static function sendAcknowledgment(&$form, $params) {
// check for online pledge.
if (!empty($params['receipt_from_email'])) {
- $userName = CRM_Utils_Array::value('receipt_from_name', $params);
- $userEmail = CRM_Utils_Array::value('receipt_from_email', $params);
+ $userName = $params['receipt_from_name'] ?? NULL;
+ $userEmail = $params['receipt_from_email'] ?? NULL;
}
elseif (!empty($params['from_email_id'])) {
$receiptFrom = $params['from_email_id'];
@@ -638,8 +638,8 @@ public static function sendAcknowledgment(&$form, $params) {
}
else {
// set the domain values.
- $userName = CRM_Utils_Array::value('name', $domainValues);
- $userEmail = CRM_Utils_Array::value('email', $domainValues);
+ $userName = $domainValues['name'] ?? NULL;
+ $userEmail = $domainValues['email'] ?? NULL;
}
if (!isset($receiptFrom)) {
diff --git a/CRM/Pledge/BAO/PledgeBlock.php b/CRM/Pledge/BAO/PledgeBlock.php
index 1ac0016cda07..8d363e06f9ac 100644
--- a/CRM/Pledge/BAO/PledgeBlock.php
+++ b/CRM/Pledge/BAO/PledgeBlock.php
@@ -90,7 +90,7 @@ public static function add(&$params) {
$pledgeBlock = new CRM_Pledge_DAO_PledgeBlock();
// fix for pledge_frequency_unit
- $freqUnits = CRM_Utils_Array::value('pledge_frequency_unit', $params);
+ $freqUnits = $params['pledge_frequency_unit'] ?? NULL;
if ($freqUnits && is_array($freqUnits)) {
unset($params['pledge_frequency_unit']);
@@ -231,7 +231,7 @@ public static function buildPledgeBlock($form) {
1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $payment), CRM_Utils_Array::value('scheduled_amount_currency', $payment)),
2 => $payment['scheduled_date'] ?? NULL,
));
- $paymentID = CRM_Utils_Array::value('id', $payment);
+ $paymentID = $payment['id'] ?? NULL;
$payments[] = $form->createElement('checkbox', $paymentID, NULL, $label, array('amount' => CRM_Utils_Array::value('scheduled_amount', $payment)));
}
}
@@ -241,7 +241,7 @@ public static function buildPledgeBlock($form) {
1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $nextPayment), CRM_Utils_Array::value('scheduled_amount_currency', $nextPayment)),
2 => $nextPayment['scheduled_date'] ?? NULL,
));
- $paymentID = CRM_Utils_Array::value('id', $nextPayment);
+ $paymentID = $nextPayment['id'] ?? NULL;
$payments[] = $form->createElement('checkbox', $paymentID, NULL, $label, array('amount' => CRM_Utils_Array::value('scheduled_amount', $nextPayment)));
}
// give error if empty or build form for payment.
diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php
index 010335cddd14..a4418c1813ba 100644
--- a/CRM/Pledge/Form/Pledge.php
+++ b/CRM/Pledge/Form/Pledge.php
@@ -205,7 +205,7 @@ public function buildQuickForm() {
}
$showAdditionalInfo = FALSE;
- $this->_formType = CRM_Utils_Array::value('formType', $_GET);
+ $this->_formType = $_GET['formType'] ?? NULL;
$defaults = [];
@@ -446,12 +446,12 @@ public function postProcess() {
'campaign_id',
];
foreach ($fields as $f) {
- $params[$f] = CRM_Utils_Array::value($f, $formValues);
+ $params[$f] = $formValues[$f] ?? NULL;
}
// format amount
$params['amount'] = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('amount', $formValues));
- $params['currency'] = CRM_Utils_Array::value('currency', $formValues);
+ $params['currency'] = $formValues['currency'] ?? NULL;
$params['original_installment_amount'] = ($params['amount'] / $params['installments']);
$dates = ['create_date', 'start_date', 'acknowledge_date', 'cancel_date'];
diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php
index fa142004dcf2..aef07fbcfa99 100644
--- a/CRM/Pledge/Selector/Search.php
+++ b/CRM/Pledge/Selector/Search.php
@@ -167,8 +167,8 @@ public function __construct(
*/
public static function &links() {
$args = func_get_args();
- $hideOption = CRM_Utils_Array::value(0, $args);
- $key = CRM_Utils_Array::value(1, $args);
+ $hideOption = $args[0] ?? NULL;
+ $key = $args[1] ?? NULL;
$extraParams = ($key) ? "&key={$key}" : NULL;
@@ -299,7 +299,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
}
// carry campaign on selectors.
- $row['campaign'] = CRM_Utils_Array::value($result->pledge_campaign_id, $allCampaigns);
+ $row['campaign'] = $allCampaigns[$result->pledge_campaign_id] ?? NULL;
$row['campaign_id'] = $result->pledge_campaign_id;
// add pledge status name
diff --git a/CRM/Pledge/StateMachine/Search.php b/CRM/Pledge/StateMachine/Search.php
index 9b8eb4a85a70..b47ba015f97c 100644
--- a/CRM/Pledge/StateMachine/Search.php
+++ b/CRM/Pledge/StateMachine/Search.php
@@ -69,7 +69,7 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) {
*/
public function taskName($controller, $formName = 'Search') {
// total hack, check POST vars and then session to determine stuff
- $value = CRM_Utils_Array::value('task', $_POST);
+ $value = $_POST['task'] ?? NULL;
if (!isset($value)) {
$value = $this->_controller->get('task');
}
diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php
index 9c5b9bd58c0c..516b2c84ec23 100644
--- a/CRM/Price/BAO/LineItem.php
+++ b/CRM/Price/BAO/LineItem.php
@@ -32,7 +32,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem {
* @throws \Exception
*/
public static function create(&$params) {
- $id = CRM_Utils_Array::value('id', $params);
+ $id = $params['id'] ?? NULL;
if ($id) {
CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
$op = CRM_Core_Action::UPDATE;
@@ -45,8 +45,8 @@ public static function create(&$params) {
// unset entity table and entity id in $params
// we never update the entity table and entity id during update mode
if ($id) {
- $entity_id = CRM_Utils_Array::value('entity_id', $params);
- $entity_table = CRM_Utils_Array::value('entity_table', $params);
+ $entity_id = $params['entity_id'] ?? NULL;
+ $entity_table = $params['entity_table'] ?? NULL;
unset($params['entity_id'], $params['entity_table']);
}
else {
@@ -242,7 +242,7 @@ public static function getLineItems($entityId, $entity = 'participant', $isQuick
$getTaxDetails = FALSE;
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$dao = CRM_Core_DAO::executeQuery("$selectClause $fromClause $whereClause $orderByClause", $params);
while ($dao->fetch()) {
@@ -286,7 +286,7 @@ public static function getLineItems($entityId, $entity = 'participant', $isQuick
}
if ($invoicing) {
// @todo - this is an inappropriate place to be doing form level assignments.
- $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
+ $taxTerm = $invoiceSettings['tax_term'] ?? NULL;
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('taxTerm', $taxTerm);
$smarty->assign('getTaxDetails', $getTaxDetails);
@@ -329,7 +329,7 @@ public static function format($fid, $params, $fields, &$values, $amount_override
else {
CRM_Price_BAO_PriceFieldValue::getValues($fid, $options, 'weight', TRUE);
}
- $fieldTitle = CRM_Utils_Array::value('label', $fields);
+ $fieldTitle = $fields['label'] ?? NULL;
if (!$fieldTitle) {
$fieldTitle = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $fid, 'label');
}
@@ -533,7 +533,7 @@ public static function getLineItemArray(&$params, $entityId = NULL, $entityTable
if (!$entityId) {
$priceSetDetails = CRM_Price_BAO_PriceSet::getDefaultPriceSet($entityTable);
$totalAmount = CRM_Utils_Array::value('partial_payment_total', $params, CRM_Utils_Array::value('total_amount', $params));
- $financialType = CRM_Utils_Array::value('financial_type_id', $params);
+ $financialType = $params['financial_type_id'] ?? NULL;
foreach ($priceSetDetails as $values) {
if ($entityTable == 'membership') {
if ($isRelatedID != $values['membership_type_id']) {
diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php
index a65ec27c09af..411d11ede55b 100644
--- a/CRM/Price/BAO/PriceField.php
+++ b/CRM/Price/BAO/PriceField.php
@@ -294,7 +294,7 @@ public static function addQuickFormElement(
$is_pay_later = 1;
}
elseif (isset($qf->_values)) {
- $is_pay_later = CRM_Utils_Array::value('is_pay_later', $qf->_values);
+ $is_pay_later = $qf->_values['is_pay_later'] ?? NULL;
}
$otherAmount = $qf->get('values');
@@ -325,15 +325,15 @@ public static function addQuickFormElement(
$valueFieldName = 'amount';
$seperator = '|';
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
- $displayOpt = CRM_Utils_Array::value('tax_display_settings', $invoiceSettings);
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $taxTerm = $invoiceSettings['tax_term'] ?? NULL;
+ $displayOpt = $invoiceSettings['tax_display_settings'] ?? NULL;
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
switch ($field->html_type) {
case 'Text':
$optionKey = key($customOption);
$count = CRM_Utils_Array::value('count', $customOption[$optionKey], '');
$max_value = CRM_Utils_Array::value('max_value', $customOption[$optionKey], '');
- $taxAmount = CRM_Utils_Array::value('tax_amount', $customOption[$optionKey]);
+ $taxAmount = $customOption[$optionKey]['tax_amount'] ?? NULL;
if (isset($taxAmount) && $displayOpt && $invoicing) {
$qf->assign('displayOpt', $displayOpt);
$qf->assign('taxTerm', $taxTerm);
@@ -400,7 +400,7 @@ public static function addQuickFormElement(
}
foreach ($customOption as $opId => $opt) {
- $taxAmount = CRM_Utils_Array::value('tax_amount', $opt);
+ $taxAmount = $opt['tax_amount'] ?? NULL;
if ($field->is_display_amounts) {
$opt['label'] = !empty($opt['label']) ? $opt['label'] . ' - ' : '';
$preHelpText = $postHelpText = '';
@@ -512,7 +512,7 @@ public static function addQuickFormElement(
$selectOption = $allowedOptions = $priceVal = [];
foreach ($customOption as $opt) {
- $taxAmount = CRM_Utils_Array::value('tax_amount', $opt);
+ $taxAmount = $opt['tax_amount'] ?? NULL;
$count = CRM_Utils_Array::value('count', $opt, '');
$max_value = CRM_Utils_Array::value('max_value', $opt, '');
@@ -568,7 +568,7 @@ public static function addQuickFormElement(
$check = [];
foreach ($customOption as $opId => $opt) {
- $taxAmount = CRM_Utils_Array::value('tax_amount', $opt);
+ $taxAmount = $opt['tax_amount'] ?? NULL;
$count = CRM_Utils_Array::value('count', $opt, '');
$max_value = CRM_Utils_Array::value('max_value', $opt, '');
diff --git a/CRM/Price/BAO/PriceFieldValue.php b/CRM/Price/BAO/PriceFieldValue.php
index a8cfdb9eff06..34d431210a9b 100644
--- a/CRM/Price/BAO/PriceFieldValue.php
+++ b/CRM/Price/BAO/PriceFieldValue.php
@@ -39,7 +39,7 @@ public static function add(&$params, $ids = []) {
$fieldValueBAO->copyValues($params);
// CRM-16189
- $priceFieldID = CRM_Utils_Array::value('price_field_id', $params);
+ $priceFieldID = $params['price_field_id'] ?? NULL;
$id = CRM_Utils_Array::value('id', $ids, CRM_Utils_Array::value('id', $params));
@@ -102,7 +102,7 @@ public static function create(&$params, $ids = []) {
}
}
- $financialType = CRM_Utils_Array::value('financial_type_id', $params, NULL);
+ $financialType = $params['financial_type_id'] ?? NULL;
if (!$financialType && $id) {
$financialType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $id, 'financial_type_id', 'id');
}
diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php
index f9e24c14d942..c0cbf660a5c9 100644
--- a/CRM/Price/BAO/PriceSet.php
+++ b/CRM/Price/BAO/PriceSet.php
@@ -61,7 +61,7 @@ public static function create(&$params) {
$params['extends'] = CRM_Utils_Array::implodePadded($params['extends']);
}
else {
- $priceSetID = CRM_Utils_Array::value('id', $params);
+ $priceSetID = $params['id'] ?? NULL;
}
$priceSetBAO = new CRM_Price_BAO_PriceSet();
$priceSetBAO->copyValues($params);
@@ -340,7 +340,7 @@ public static function getSetId(&$params) {
}
}
else {
- $fid = CRM_Utils_Array::value('fid', $params);
+ $fid = $params['fid'] ?? NULL;
}
if (isset($fid)) {
@@ -603,8 +603,8 @@ public static function initSet(&$form, $entityTable = 'civicrm_event', $validOnl
$form->_priceSetId = $priceSetId;
$priceSet = self::getSetDetail($priceSetId, $required, $validOnly);
- $form->_priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
- $form->_values['fee'] = CRM_Utils_Array::value('fields', $form->_priceSet);
+ $form->_priceSet = $priceSet[$priceSetId] ?? NULL;
+ $form->_values['fee'] = $form->_priceSet['fields'] ?? NULL;
//get the price set fields participant count.
if ($entityTable == 'civicrm_event') {
@@ -829,7 +829,7 @@ public static function buildPriceSet(&$form) {
}
$priceSet = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
- $form->_priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
+ $form->_priceSet = $priceSet[$priceSetId] ?? NULL;
$validPriceFieldIds = array_keys($form->_priceSet['fields']);
$form->_quickConfig = $quickConfig = 0;
if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config')) {
@@ -900,7 +900,7 @@ public static function buildPriceSet(&$form) {
(CRM_Utils_Array::value('visibility', $field) == 'admin' && $adminFieldVisible == TRUE) ||
!$validFieldsOnly
) {
- $options = CRM_Utils_Array::value('options', $field);
+ $options = $field['options'] ?? NULL;
if ($className == 'CRM_Contribute_Form_Contribution_Main' && $component = 'membership') {
$userid = $form->getVar('_membershipContactID');
$checklifetime = self::checkCurrentMembership($options, $userid);
diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php
index 5e4a5c4e8d25..c8e0f2a7b7da 100644
--- a/CRM/Price/Form/Field.php
+++ b/CRM/Price/Form/Field.php
@@ -574,7 +574,7 @@ public static function formRule($fields, $files, $form) {
for ($index = 1; $index <= self::NUM_OPTION; $index++) {
$isOptionSet = !empty($fields['option_label'][$index]) || !empty($fields['option_amount'][$index]);
- $currentOptionVisibility = CRM_Utils_Array::value($fields['option_visibility_id'][$index], $visibilityOptions);
+ $currentOptionVisibility = $visibilityOptions[$fields['option_visibility_id'][$index]] ?? NULL;
if ($isOptionSet && $currentOptionVisibility == 'public') {
$errors["option_visibility_id[{$index}]"] = ts('\'Admin\' field should only have \'Admin\' visibility options.');
diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php
index 47f45516f22c..96a5b53cb349 100644
--- a/CRM/Price/Form/Set.php
+++ b/CRM/Price/Form/Set.php
@@ -269,7 +269,7 @@ public function postProcess() {
$params['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params, FALSE);
$compIds = [];
- $extends = CRM_Utils_Array::value('extends', $params);
+ $extends = $params['extends'] ?? NULL;
if (is_array($extends)) {
foreach ($extends as $compId => $selected) {
if ($selected) {
diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php
index 8279fc310a7b..141670e4d10b 100644
--- a/CRM/Price/Page/Field.php
+++ b/CRM/Price/Page/Field.php
@@ -111,8 +111,8 @@ public function browse() {
// display taxTerm for priceFields
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $taxTerm = $invoiceSettings['tax_term'] ?? NULL;
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$getTaxDetails = FALSE;
$taxRate = CRM_Core_PseudoConstant::getTaxRates();
CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes);
@@ -126,7 +126,7 @@ public function browse() {
$params = ['price_field_id' => $priceFieldBAO->id];
CRM_Price_BAO_PriceFieldValue::retrieve($params, $optionValues);
- $priceField[$priceFieldBAO->id]['price'] = CRM_Utils_Array::value('amount', $optionValues);
+ $priceField[$priceFieldBAO->id]['price'] = $optionValues['amount'] ?? NULL;
$financialTypeId = $optionValues['financial_type_id'];
if ($invoicing && isset($taxRate[$financialTypeId])) {
$priceField[$priceFieldBAO->id]['tax_rate'] = $taxRate[$financialTypeId];
diff --git a/CRM/Price/Page/Option.php b/CRM/Price/Page/Option.php
index f7b46ab6893b..df3b6a3fc99a 100644
--- a/CRM/Price/Page/Option.php
+++ b/CRM/Price/Page/Option.php
@@ -130,8 +130,8 @@ public function browse() {
$taxRate = CRM_Core_PseudoConstant::getTaxRates();
// display taxTerm for priceFields
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
- $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
- $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $taxTerm = $invoiceSettings['tax_term'] ?? NULL;
+ $invoicing = $invoiceSettings['invoicing'] ?? NULL;
$getTaxDetails = FALSE;
foreach ($customOption as $id => $values) {
$action = array_sum(array_keys(self::actionLinks()));
diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php
index f8f7f01b9b48..39fae8b8f6ca 100644
--- a/CRM/Profile/Form.php
+++ b/CRM/Profile/Form.php
@@ -994,7 +994,7 @@ public static function formRule($fields, $files, $form) {
if (!$register && empty($fields['_qf_Edit_upload_duplicate'])) {
// fix for CRM-3240
if (!empty($fields['email-Primary'])) {
- $fields['email'] = CRM_Utils_Array::value('email-Primary', $fields);
+ $fields['email'] = $fields['email-Primary'] ?? NULL;
}
// fix for CRM-6141
@@ -1187,7 +1187,7 @@ public function postProcess() {
}
}
- $addToGroupId = CRM_Utils_Array::value('add_to_group_id', $this->_ufGroup);
+ $addToGroupId = $this->_ufGroup['add_to_group_id'] ?? NULL;
if (!empty($addToGroupId)) {
//run same check whether group is a mailing list
$groupTypes = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group',
diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php
index 29c350841ada..57f51cc3c22b 100644
--- a/CRM/Profile/Form/Edit.php
+++ b/CRM/Profile/Form/Edit.php
@@ -188,7 +188,7 @@ public function buildQuickForm() {
$this->_cancelURL = str_replace('&', '&', $this->_cancelURL);
// also retain error URL if set
- $this->_errorURL = CRM_Utils_Array::value('errorURL', $_POST);
+ $this->_errorURL = $_POST['errorURL'] ?? NULL;
if ($this->_errorURL) {
// we do this gross hack since qf also does entity replacement
$this->_errorURL = str_replace('&', '&', $this->_errorURL);
@@ -252,7 +252,7 @@ public function postProcess() {
]);
foreach (explode(',', $this->returnExtra) as $field) {
$field = trim($field);
- $this->ajaxResponse['extra'][$field] = CRM_Utils_Array::value($field, $contact);
+ $this->ajaxResponse['extra'][$field] = $contact[$field] ?? NULL;
}
}
diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php
index 0b84b8753e91..46807507ce54 100644
--- a/CRM/Profile/Page/Listings.php
+++ b/CRM/Profile/Page/Listings.php
@@ -205,7 +205,7 @@ public function preProcess() {
}
}
- $customField = CRM_Utils_Array::value($name, $this->_customFields);
+ $customField = $this->_customFields[$name] ?? NULL;
if (!empty($_POST) && empty($_POST[$name])) {
if ($customField) {
@@ -410,7 +410,7 @@ public static function getProfileContact($gid) {
CRM_Core_Error::statusBounce(ts('This profile does not have the map feature turned on.'));
}
- $groupId = CRM_Utils_Array::value('limit_listings_group_id', $details);
+ $groupId = $details['limit_listings_group_id'] ?? NULL;
// add group id to params if a uf group belong to a any group
if ($groupId) {
diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php
index 0593c82c3d04..18cba944bfb6 100644
--- a/CRM/Profile/Page/MultipleRecordFieldsListing.php
+++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php
@@ -220,7 +220,7 @@ public function browse() {
$dateFields[$fieldIDs[$key]] = 1;
$actualPHPFormats = CRM_Utils_Date::datePluginToPHPFormats();
$dateFormat = (array) CRM_Utils_Array::value($returnValues['date_format'], $actualPHPFormats);
- $timeFormat = CRM_Utils_Array::value('time_format', $returnValues);
+ $timeFormat = $returnValues['time_format'] ?? NULL;
}
$optionValuePairs = CRM_Core_BAO_CustomOption::getCustomOption($fieldIDs[$key]);
@@ -233,12 +233,12 @@ public function browse() {
$options[$fieldIDs[$key]]['attributes']['html_type'] = $returnValues['html_type'];
$options[$fieldIDs[$key]]['attributes']['data_type'] = $returnValues['data_type'];
$options[$fieldIDs[$key]]['attributes']['is_required'] = !empty($returnValues['is_required']);
- $options[$fieldIDs[$key]]['attributes']['default_value'] = CRM_Utils_Array::value('default_value', $returnValues);
- $options[$fieldIDs[$key]]['attributes']['is_view'] = CRM_Utils_Array::value('is_view', $returnValues);
+ $options[$fieldIDs[$key]]['attributes']['default_value'] = $returnValues['default_value'] ?? NULL;
+ $options[$fieldIDs[$key]]['attributes']['is_view'] = $returnValues['is_view'] ?? NULL;
$options[$fieldIDs[$key]]['attributes']['format']
- = $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
- $options[$fieldIDs[$key]]['attributes']['time_format'] = CRM_Utils_Array::value('time_format', $returnValues);
+ = $options[$fieldIDs[$key]]['attributes']['date_format'] = $returnValues['date_format'] ?? NULL;
+ $options[$fieldIDs[$key]]['attributes']['time_format'] = $returnValues['time_format'] ?? NULL;
}
$linkAction = array_sum(array_keys($this->links()));
}
diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php
index 09eb0a6e98e9..8c7cd1995991 100644
--- a/CRM/Profile/Selector/Listings.php
+++ b/CRM/Profile/Selector/Listings.php
@@ -307,9 +307,9 @@ public function &getColumnHeaders($action = NULL, $output = NULL) {
if (strpos($name, '-') !== FALSE) {
$value = explode('-', $name);
- $fieldName = CRM_Utils_Array::value(0, $value);
- $lType = CRM_Utils_Array::value(1, $value);
- $type = CRM_Utils_Array::value(2, $value);
+ $fieldName = $value[0] ?? NULL;
+ $lType = $value[1] ?? NULL;
+ $type = $value[2] ?? NULL;
if (!in_array($fieldName, $multipleFields)) {
if ($lType == 'Primary') {
@@ -380,7 +380,7 @@ public function getTotalCount($action) {
if ($this->_multiRecordTableName &&
!array_key_exists($this->_multiRecordTableName, $this->_query->_whereTables)
) {
- $additionalFromClause = CRM_Utils_Array::value($this->_multiRecordTableName, $this->_query->_tables);
+ $additionalFromClause = $this->_query->_tables[$this->_multiRecordTableName] ?? NULL;
$returnQuery = TRUE;
}
@@ -436,7 +436,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $ex
foreach ($vars as $key => $field) {
$field = $vars[$key];
$fieldArray = explode('-', $field['name']);
- $fieldType = CRM_Utils_Array::value('2', $fieldArray);
+ $fieldType = $fieldArray['2'] ?? NULL;
if (is_numeric(CRM_Utils_Array::value('1', $fieldArray))) {
if (!in_array($fieldType, $multipleFields)) {
$locationType = new CRM_Core_DAO_LocationType();
@@ -513,14 +513,14 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $ex
) {
if (strpos($key, '-') !== FALSE) {
$value = explode('-', $key);
- $fieldName = CRM_Utils_Array::value(0, $value);
- $id = CRM_Utils_Array::value(1, $value);
- $type = CRM_Utils_Array::value(2, $value);
+ $fieldName = $value[0] ?? NULL;
+ $id = $value[1] ?? NULL;
+ $type = $value[2] ?? NULL;
if (!in_array($fieldName, $multipleFields)) {
$locationTypeName = NULL;
if (is_numeric($id)) {
- $locationTypeName = CRM_Utils_Array::value($id, $locationTypes);
+ $locationTypeName = $locationTypes[$id] ?? NULL;
}
else {
if ($id == 'Primary') {
diff --git a/CRM/Queue/Runner.php b/CRM/Queue/Runner.php
index d44a073b5232..36588d5aeb9a 100644
--- a/CRM/Queue/Runner.php
+++ b/CRM/Queue/Runner.php
@@ -97,8 +97,8 @@ public function __construct($runnerSpec) {
$this->queue = $runnerSpec['queue'];
$this->errorMode = CRM_Utils_Array::value('errorMode', $runnerSpec, self::ERROR_ABORT);
$this->isMinimal = CRM_Utils_Array::value('isMinimal', $runnerSpec, FALSE);
- $this->onEnd = CRM_Utils_Array::value('onEnd', $runnerSpec, NULL);
- $this->onEndUrl = CRM_Utils_Array::value('onEndUrl', $runnerSpec, NULL);
+ $this->onEnd = $runnerSpec['onEnd'] ?? NULL;
+ $this->onEndUrl = $runnerSpec['onEndUrl'] ?? NULL;
$this->pathPrefix = CRM_Utils_Array::value('pathPrefix', $runnerSpec, 'civicrm/queue');
$this->buttons = CRM_Utils_Array::value('buttons', $runnerSpec, ['retry' => TRUE, 'skip' => TRUE]);
// perhaps this value should be randomized?
diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php
index 2c7f1034288d..c396235d405f 100644
--- a/CRM/Report/BAO/ReportInstance.php
+++ b/CRM/Report/BAO/ReportInstance.php
@@ -114,10 +114,10 @@ public static function add(&$params) {
*/
public static function &create(&$params) {
if (isset($params['report_header'])) {
- $params['header'] = CRM_Utils_Array::value('report_header', $params);
+ $params['header'] = $params['report_header'] ?? NULL;
}
if (isset($params['report_footer'])) {
- $params['footer'] = CRM_Utils_Array::value('report_footer', $params);
+ $params['footer'] = $params['report_footer'] ?? NULL;
}
// build navigation parameters
@@ -131,8 +131,8 @@ public static function &create(&$params) {
$navigationParams['label'] = $params['title'];
$navigationParams['name'] = $params['title'];
- $navigationParams['current_parent_id'] = CRM_Utils_Array::value('parent_id', $navigationParams);
- $navigationParams['parent_id'] = CRM_Utils_Array::value('parent_id', $params);
+ $navigationParams['current_parent_id'] = $navigationParams['parent_id'] ?? NULL;
+ $navigationParams['parent_id'] = $params['parent_id'] ?? NULL;
$navigationParams['is_active'] = 1;
if ($permission = CRM_Utils_Array::value('permission', $params)) {
diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php
index cf099a3debbe..10b79fb4111e 100644
--- a/CRM/Report/Form.php
+++ b/CRM/Report/Form.php
@@ -614,7 +614,7 @@ public function preProcessCommon() {
CRM_Utils_System::civiExit();
}
- $formValues = CRM_Utils_Array::value('form_values', $this->_instanceValues);
+ $formValues = $this->_instanceValues['form_values'] ?? NULL;
if ($formValues) {
$this->_formValues = CRM_Utils_String::unserialize($formValues);
}
@@ -947,8 +947,8 @@ public function setDefaultValues($freeze = TRUE) {
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE
) {
if (is_array($field['default'])) {
- $this->_defaults["{$fieldName}_from"] = CRM_Utils_Array::value('from', $field['default']);
- $this->_defaults["{$fieldName}_to"] = CRM_Utils_Array::value('to', $field['default']);
+ $this->_defaults["{$fieldName}_from"] = $field['default']['from'] ?? NULL;
+ $this->_defaults["{$fieldName}_to"] = $field['default']['to'] ?? NULL;
$this->_defaults["{$fieldName}_relative"] = 0;
}
else {
@@ -957,8 +957,8 @@ public function setDefaultValues($freeze = TRUE) {
}
else {
if ((CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_INT) && is_array($field['default'])) {
- $this->_defaults["{$fieldName}_min"] = CRM_Utils_Array::value('min', $field['default']);
- $this->_defaults["{$fieldName}_max"] = CRM_Utils_Array::value('max', $field['default']);
+ $this->_defaults["{$fieldName}_min"] = $field['default']['min'] ?? NULL;
+ $this->_defaults["{$fieldName}_max"] = $field['default']['max'] ?? NULL;
}
$this->_defaults["{$fieldName}_value"] = $field['default'];
}
@@ -1216,11 +1216,11 @@ public function addColumns() {
$colGroups[$tableName]['use_accordian_for_field_selection'] = TRUE;
}
- $colGroups[$tableName]['fields'][$fieldName] = CRM_Utils_Array::value('title', $field);
+ $colGroups[$tableName]['fields'][$fieldName] = $field['title'] ?? NULL;
if ($groupTitle && empty($colGroups[$tableName]['group_title'])) {
$colGroups[$tableName]['group_title'] = $groupTitle;
}
- $options[$fieldName] = CRM_Utils_Array::value('title', $field);
+ $options[$fieldName] = $field['title'] ?? NULL;
}
}
}
@@ -2741,9 +2741,9 @@ public function select() {
public function selectClause(&$tableName, $tableKey, &$fieldName, &$field) {
if (!empty($field['pseudofield'])) {
$alias = "{$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['dbAlias'] = CRM_Utils_Array::value('dbAlias', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['dbAlias'] = $field['dbAlias'] ?? NULL;
$this->_selectAliases[] = $alias;
return ' 1 as ' . $alias;
}
@@ -3031,7 +3031,7 @@ public function storeOrderByArray() {
// Record any section headers for assignment to the template
if (!empty($orderBy['section'])) {
- $orderByField['pageBreak'] = CRM_Utils_Array::value('pageBreak', $orderBy);
+ $orderByField['pageBreak'] = $orderBy['pageBreak'] ?? NULL;
$this->_sections[$orderByField['tplField']] = $orderByField;
}
}
@@ -3326,16 +3326,16 @@ public function filterStat(&$statistics) {
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
$value = NULL;
if ($op) {
$pair = $this->getOperationPair(
CRM_Utils_Array::value('operatorType', $field),
$fieldName
);
- $min = CRM_Utils_Array::value("{$fieldName}_min", $this->_params);
- $max = CRM_Utils_Array::value("{$fieldName}_max", $this->_params);
- $val = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
+ $min = $this->_params["{$fieldName}_min"] ?? NULL;
+ $max = $this->_params["{$fieldName}_max"] ?? NULL;
+ $val = $this->_params["{$fieldName}_value"] ?? NULL;
if (in_array($op, ['bw', 'nbw']) && ($min || $max)) {
$value = "{$pair[$op]} $min " . ts('and') . " $max";
}
@@ -5317,8 +5317,8 @@ protected function addStatisticsToSelect($field, $tableName, $fieldName, $select
protected function addBasicFieldToSelect($tableName, $fieldName, $field, $select) {
$alias = "{$tableName}_{$fieldName}";
$select[] = "{$field['dbAlias']} as $alias";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
$this->_selectAliases[] = $alias;
return $select;
}
@@ -5955,7 +5955,7 @@ protected function getDefaultsFromOptions($options) {
protected function getSelectClauseWithGroupConcatIfNotGroupedBy($tableName, &$fieldName, &$field) {
if ($this->groupConcatTested && (!empty($this->_groupByArray) || $this->isForceGroupBy)) {
if ((empty($field['statistics']) || in_array('GROUP_CONCAT', $field['statistics']))) {
- $label = CRM_Utils_Array::value('title', $field);
+ $label = $field['title'] ?? NULL;
$alias = $field['tplField'] ?? "{$tableName}_{$fieldName}";
$this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $label;
$this->_selectAliases[] = $alias;
@@ -5983,24 +5983,24 @@ protected function generateFilterClause($field, $fieldName) {
if (CRM_Utils_Array::value('operatorType', $field) ==
CRM_Report_Form::OP_MONTH
) {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
- $value = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
+ $value = $this->_params["{$fieldName}_value"] ?? NULL;
if (is_array($value) && !empty($value)) {
return "(month({$field['dbAlias']}) $op (" . implode(', ', $value) .
'))';
}
}
else {
- $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);
- $fromTime = CRM_Utils_Array::value("{$fieldName}_from_time", $this->_params);
- $toTime = CRM_Utils_Array::value("{$fieldName}_to_time", $this->_params);
+ $relative = $this->_params["{$fieldName}_relative"] ?? NULL;
+ $from = $this->_params["{$fieldName}_from"] ?? NULL;
+ $to = $this->_params["{$fieldName}_to"] ?? NULL;
+ $fromTime = $this->_params["{$fieldName}_from_time"] ?? NULL;
+ $toTime = $this->_params["{$fieldName}_to_time"] ?? NULL;
return $this->dateClause($field['dbAlias'], $relative, $from, $to, $field['type'], $fromTime, $toTime);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
return $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php
index fa98ce2afda7..6bd904d4d73b 100644
--- a/CRM/Report/Form/Activity.php
+++ b/CRM/Report/Form/Activity.php
@@ -536,14 +536,14 @@ public function where($recordType = NULL) {
continue;
}
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op && !($fieldName == "contact_{$recordType}" && ($op != 'nnll' || $op != 'nll'))) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php
index e607a8b70fb7..0e7e780f9159 100644
--- a/CRM/Report/Form/ActivitySummary.php
+++ b/CRM/Report/Form/ActivitySummary.php
@@ -260,15 +260,15 @@ public function select() {
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
}
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
}
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
}
}
}
@@ -364,14 +364,14 @@ public function where($durationMode = FALSE) {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php
index 8b524e07b3a1..97a685973d67 100644
--- a/CRM/Report/Form/Campaign/SurveyDetails.php
+++ b/CRM/Report/Form/Campaign/SurveyDetails.php
@@ -250,7 +250,7 @@ public function select() {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
// Set default title
- $title = CRM_Utils_Array::value('title', $field);
+ $title = $field['title'] ?? NULL;
// Check for an override.
if (!empty($this->_columnTitleOverrides["{$tableName}_{$fieldName}"])) {
$title = $this->_columnTitleOverrides["{$tableName}_{$fieldName}"];
@@ -309,14 +309,14 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
@@ -371,7 +371,7 @@ public function compileContent() {
*/
private function _surveyCoverSheet() {
$coverSheet = NULL;
- $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params);
+ $surveyIds = $this->_params['survey_id_value'] ?? NULL;
if (CRM_Utils_System::isNull($surveyIds)) {
return $coverSheet;
}
@@ -498,7 +498,7 @@ public function alterDisplay(&$rows) {
* @param $rows
*/
private function _formatSurveyResult(&$rows) {
- $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params);
+ $surveyIds = $this->_params['survey_id_value'] ?? NULL;
if (CRM_Utils_System::isNull($surveyIds) ||
empty($this->_params['fields']['result']) ||
!in_array($this->_outputMode, array('print', 'pdf'))
@@ -523,16 +523,16 @@ private function _formatSurveyResult(&$rows) {
$resultSet[$result->id][$result->value] = $result->label;
}
- $statusId = CRM_Utils_Array::value('status_id_value', $this->_params);
- $respondentStatus = CRM_Utils_Array::value($statusId, self::$_surveyRespondentStatus);
+ $statusId = $this->_params['status_id_value'] ?? NULL;
+ $respondentStatus = self::$_surveyRespondentStatus[$statusId] ?? NULL;
- $surveyId = CRM_Utils_Array::value(0, $surveyIds);
+ $surveyId = $surveyIds[0] ?? NULL;
foreach ($rows as & $row) {
if (!empty($row['civicrm_activity_survey_id'])) {
$surveyId = $row['civicrm_activity_survey_id'];
}
$result = CRM_Utils_Array::value($surveyId, $resultSet, array());
- $resultLabel = CRM_Utils_Array::value('civicrm_activity_result', $row);
+ $resultLabel = $row['civicrm_activity_result'] ?? NULL;
if ($respondentStatus == 'Reserved') {
$row['civicrm_activity_result'] = implode(' | ', array_keys($result));
}
@@ -549,7 +549,7 @@ private function _formatSurveyResult(&$rows) {
* @param $rows
*/
private function _formatSurveyResponseData(&$rows) {
- $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params);
+ $surveyIds = $this->_params['survey_id_value'] ?? NULL;
if (CRM_Utils_System::isNull($surveyIds) ||
empty($this->_params['fields']['survey_response'])
) {
@@ -586,8 +586,8 @@ private function _formatSurveyResponseData(&$rows) {
}
//do check respondent status.
- $statusId = CRM_Utils_Array::value('status_id_value', $this->_params);
- $respondentStatus = CRM_Utils_Array::value($statusId, self::$_surveyRespondentStatus);
+ $statusId = $this->_params['status_id_value'] ?? NULL;
+ $respondentStatus = self::$_surveyRespondentStatus[$statusId] ?? NULL;
if (!$hasResponseData &&
($respondentStatus != 'Reserved')
@@ -655,7 +655,7 @@ private function _formatSurveyResponseData(&$rows) {
if ($respondentStatus == 'Reserved' &&
in_array($this->_outputMode, array('print', 'pdf'))
) {
- $optGrpId = CRM_Utils_Array::value('option_group_id', $responseFields[$name]);
+ $optGrpId = $responseFields[$name]['option_group_id'] ?? NULL;
$options = CRM_Utils_Array::value($optGrpId, $fieldValueMap, array());
$value = implode(' | ', array_keys($options));
}
@@ -671,7 +671,7 @@ private function _formatSurveyResponseData(&$rows) {
}
private function _addSurveyResponseColumns() {
- $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params);
+ $surveyIds = $this->_params['survey_id_value'] ?? NULL;
if (CRM_Utils_System::isNull($surveyIds) ||
empty($this->_params['fields']['survey_response'])
) {
diff --git a/CRM/Report/Form/Case/Demographics.php b/CRM/Report/Form/Case/Demographics.php
index 8115604f0209..6c9f105f8596 100644
--- a/CRM/Report/Form/Case/Demographics.php
+++ b/CRM/Report/Form/Case/Demographics.php
@@ -250,7 +250,7 @@ public function select() {
}
$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 @@ public function where() {
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)";
}
diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php
index 64d8952e714a..95a91ff9b313 100644
--- a/CRM/Report/Form/Case/Detail.php
+++ b/CRM/Report/Form/Case/Detail.php
@@ -350,7 +350,7 @@ public function select() {
$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'];
}
}
@@ -417,15 +417,15 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($fieldName == 'case_type_id' &&
!empty($this->_params['case_type_id_value'])
) {
diff --git a/CRM/Report/Form/Case/Summary.php b/CRM/Report/Form/Case/Summary.php
index ab089194bb27..52fb291cc17d 100644
--- a/CRM/Report/Form/Case/Summary.php
+++ b/CRM/Report/Form/Case/Summary.php
@@ -209,7 +209,7 @@ public function select() {
else {
$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'];
}
}
diff --git a/CRM/Report/Form/Case/TimeSpent.php b/CRM/Report/Form/Case/TimeSpent.php
index 5e3d04bca839..117b342aa458 100644
--- a/CRM/Report/Form/Case/TimeSpent.php
+++ b/CRM/Report/Form/Case/TimeSpent.php
@@ -183,9 +183,9 @@ public function select() {
)
) {
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
if ($fieldName == 'activity_type_id') {
$this->has_activity_type = TRUE;
@@ -240,18 +240,18 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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);
}
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_activity']}.id Is Not Null)";
}
diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php
index 80e033a0704c..5a2479b14b64 100644
--- a/CRM/Report/Form/Contact/CurrentEmployer.php
+++ b/CRM/Report/Form/Contact/CurrentEmployer.php
@@ -196,8 +196,8 @@ public function select() {
) {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
@@ -239,14 +239,14 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('operatorType', $field) & 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, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php
index 56acf7e33478..c44891b94ca0 100644
--- a/CRM/Report/Form/Contact/Detail.php
+++ b/CRM/Report/Form/Contact/Detail.php
@@ -389,8 +389,8 @@ public function select() {
//isolate the select clause compoenent wise
if (in_array($table['alias'], $this->_component)) {
$select[$table['alias']][] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeadersComponent[$table['alias']]["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeadersComponent[$table['alias']]["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeadersComponent[$table['alias']]["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeadersComponent[$table['alias']]["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
elseif ($table['alias'] ==
$this->_aliases['civicrm_activity_target'] ||
@@ -413,12 +413,12 @@ public function select() {
$tableName = $table['alias'];
$select['activity_civireport'][] = "$tableName.display_name as {$tableName}_{$fieldName}, $addContactId ";
- $this->_columnHeadersComponent['activity_civireport']["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeadersComponent['activity_civireport']["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeadersComponent['activity_civireport']["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeadersComponent['activity_civireport']["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
else {
$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'];
}
}
@@ -606,14 +606,14 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('operatorType', $field) & 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);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
$clause = $this->whereClause($field,
$op,
CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
diff --git a/CRM/Report/Form/Contact/Log.php b/CRM/Report/Form/Contact/Log.php
index e846ca577550..3fbec1121264 100644
--- a/CRM/Report/Form/Contact/Log.php
+++ b/CRM/Report/Form/Contact/Log.php
@@ -136,7 +136,7 @@ public function select() {
) {
$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'];
}
}
@@ -181,14 +181,14 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('operatorType', $field) & 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);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php
index 751a00eb913a..c3ed3f542922 100644
--- a/CRM/Report/Form/Contact/LoggingSummary.php
+++ b/CRM/Report/Form/Contact/LoggingSummary.php
@@ -294,7 +294,7 @@ public function from() {
$detail = $this->_logTables[$entity];
$tableName = CRM_Utils_Array::value('table_name', $detail, $entity);
- $clause = CRM_Utils_Array::value('entity_table', $detail);
+ $clause = $detail['entity_table'] ?? NULL;
$clause = $clause ? "AND entity_log_civireport.entity_table = 'civicrm_contact'" : NULL;
$joinClause = "
@@ -302,7 +302,7 @@ public function from() {
ON (entity_log_civireport.{$detail['fk']} = modified_contact_civireport.id {$clause})";
if (!empty($detail['joins'])) {
- $clause = CRM_Utils_Array::value('entity_table', $detail);
+ $clause = $detail['entity_table'] ?? NULL;
$clause = $clause ? "AND fk_table.entity_table = 'civicrm_contact'" : NULL;
$joinClause = "
INNER JOIN `{$this->loggingDB}`.{$detail['joins']['table']} fk_table ON {$detail['joins']['join']}
diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php
index 4807844732a6..1b122fe7e2e6 100644
--- a/CRM/Report/Form/Contact/Relationship.php
+++ b/CRM/Report/Form/Contact/Relationship.php
@@ -372,8 +372,8 @@ public function select() {
$this->_phoneField_b = TRUE;
}
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
@@ -454,9 +454,9 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($fieldName == 'active_period_date') {
$clause = $this->activeClause($field['name'], $relative, $from, $to, $field['type']);
@@ -466,14 +466,14 @@ public function where() {
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
if (($tableName == 'civicrm_contact' ||
$tableName == 'civicrm_contact_b') &&
($fieldName == 'contact_type_a' ||
$fieldName == 'contact_type_b')
) {
- $cTypes = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
+ $cTypes = $this->_params["{$fieldName}_value"] ?? NULL;
$contactTypes = $contactSubTypes = [];
if (!empty($cTypes)) {
foreach ($cTypes as $ctype) {
@@ -630,7 +630,7 @@ public function groupBy() {
}
public function beginPostProcessCommon() {
- $originalRelationshipTypeIdValue = CRM_Utils_Array::value('relationship_type_id_value', $this->_params);
+ $originalRelationshipTypeIdValue = $this->_params['relationship_type_id_value'] ?? NULL;
if ($originalRelationshipTypeIdValue) {
$relationshipTypes = [];
$direction = [];
diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php
index 24dc5ba2b067..1da37dac5680 100644
--- a/CRM/Report/Form/Contribute/Bookkeeping.php
+++ b/CRM/Report/Form/Contribute/Bookkeeping.php
@@ -450,7 +450,7 @@ public function select() {
break;
}
$this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'];
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
}
}
@@ -533,14 +533,14 @@ public function where() {
END";
}
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
@@ -674,7 +674,7 @@ public function alterDisplay(&$rows) {
}
if (!empty($row['civicrm_financial_trxn_card_type_id'])) {
- $rows[$rowNum]['civicrm_financial_trxn_card_type_id'] = CRM_Utils_Array::value($row['civicrm_financial_trxn_card_type_id'], $creditCardTypes);
+ $rows[$rowNum]['civicrm_financial_trxn_card_type_id'] = $creditCardTypes[$row['civicrm_financial_trxn_card_type_id']] ?? NULL;
$entryFound = TRUE;
}
diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php
index 294c40ecdd50..2fb0325d9846 100644
--- a/CRM/Report/Form/Contribute/Detail.php
+++ b/CRM/Report/Form/Contribute/Detail.php
@@ -697,7 +697,7 @@ public function alterDisplay(&$rows) {
$entryFound = TRUE;
}
if (!empty($row['civicrm_batch_batch_id'])) {
- $rows[$rowNum]['civicrm_batch_batch_id'] = CRM_Utils_Array::value($row['civicrm_batch_batch_id'], $batches);
+ $rows[$rowNum]['civicrm_batch_batch_id'] = $batches[$row['civicrm_batch_batch_id']] ?? NULL;
$entryFound = TRUE;
}
if (!empty($row['civicrm_financial_trxn_card_type_id'])) {
diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php
index 99983fcf3f07..ecb52f68ece8 100644
--- a/CRM/Report/Form/Contribute/History.php
+++ b/CRM/Report/Form/Contribute/History.php
@@ -326,7 +326,7 @@ public function select() {
) {
if ($tableName == 'civicrm_relationship') {
$this->_relationshipColumns["{$tableName}_{$fieldName}"] = "{$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'];
continue;
}
@@ -355,7 +355,7 @@ public function select() {
}
else {
$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'];
}
if (!empty($field['no_display'])) {
@@ -403,14 +403,14 @@ public function where() {
}
elseif (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php
index 1789bcd33a12..8e0c9a242206 100644
--- a/CRM/Report/Form/Contribute/HouseholdSummary.php
+++ b/CRM/Report/Form/Contribute/HouseholdSummary.php
@@ -214,8 +214,8 @@ public function select() {
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
}
}
@@ -250,13 +250,13 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
if ($fieldName == 'relationship_type_id') {
$clause = "{$this->_aliases['civicrm_relationship']}.relationship_type_id=" . $this->relationshipId;
diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php
index 80880b15d710..78d7d6282327 100644
--- a/CRM/Report/Form/Contribute/OrganizationSummary.php
+++ b/CRM/Report/Form/Contribute/OrganizationSummary.php
@@ -219,8 +219,8 @@ public function select() {
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
}
}
@@ -257,14 +257,14 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
if ($fieldName == 'relationship_type_id') {
$clause = "{$this->_aliases['civicrm_relationship']}.relationship_type_id=" . $this->relationshipId;
diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php
index 8b0ec5f5e59a..3b640a8d6dc8 100644
--- a/CRM/Report/Form/Contribute/PCP.php
+++ b/CRM/Report/Form/Contribute/PCP.php
@@ -250,13 +250,13 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
diff --git a/CRM/Report/Form/Contribute/Recur.php b/CRM/Report/Form/Contribute/Recur.php
index bf79da024452..4dac3ad8f942 100644
--- a/CRM/Report/Form/Contribute/Recur.php
+++ b/CRM/Report/Form/Contribute/Recur.php
@@ -293,9 +293,9 @@ public function where() {
if (!empty($this->_params['calculated_end_date_' . $suffix])) {
// The calculated date field is in use - spring into action
// Gather values
- $relative = CRM_Utils_Array::value("calculated_end_date_relative", $this->_params);
- $from = CRM_Utils_Array::value("calculated_end_date_from", $this->_params);
- $to = CRM_Utils_Array::value("calculated_end_date_to", $this->_params);
+ $relative = $this->_params["calculated_end_date_relative"] ?? NULL;
+ $from = $this->_params["calculated_end_date_from"] ?? NULL;
+ $to = $this->_params["calculated_end_date_to"] ?? NULL;
$end_date_db_alias = $this->_columns['civicrm_contribution_recur']['filters']['end_date']['dbAlias'];
$end_date_type = $this->_columns['civicrm_contribution_recur']['filters']['end_date']['type'];
$start_date_type = $this->_columns['civicrm_contribution_recur']['filters']['start_date']['type'];
diff --git a/CRM/Report/Form/Contribute/RecurSummary.php b/CRM/Report/Form/Contribute/RecurSummary.php
index 677890e14439..9599ddb5d143 100644
--- a/CRM/Report/Form/Contribute/RecurSummary.php
+++ b/CRM/Report/Form/Contribute/RecurSummary.php
@@ -166,8 +166,8 @@ public function select() {
}
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
@@ -222,9 +222,9 @@ public function alterDisplay(&$rows) {
$entryFound = FALSE;
- $startDateFrom = CRM_Utils_Array::value("start_date_to", $this->_params);
- $startDateTo = CRM_Utils_Array::value("start_date_from", $this->_params);
- $startDateRelative = CRM_Utils_Array::value("start_date_relative", $this->_params);
+ $startDateFrom = $this->_params["start_date_to"] ?? NULL;
+ $startDateTo = $this->_params["start_date_from"] ?? NULL;
+ $startDateRelative = $this->_params["start_date_relative"] ?? NULL;
$startedDateSql = $this->dateClause('start_date', $startDateRelative, $startDateFrom, $startDateTo);
$startedDateSql = $startedDateSql ? $startedDateSql : " ( 1 ) ";
@@ -236,7 +236,7 @@ public function alterDisplay(&$rows) {
foreach ($rows as $rowNum => $row) {
- $paymentInstrumentId = CRM_Utils_Array::value('civicrm_contribution_recur_payment_instrument_id', $row);
+ $paymentInstrumentId = $row['civicrm_contribution_recur_payment_instrument_id'] ?? NULL;
$rows[$rowNum]['civicrm_contribution_recur_start_date'] = 0;
$rows[$rowNum]['civicrm_contribution_recur_cancel_date'] = 0;
diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php
index 4062c0090e9c..7b66f28d6d32 100644
--- a/CRM/Report/Form/Contribute/Repeat.php
+++ b/CRM/Report/Form/Contribute/Repeat.php
@@ -263,17 +263,17 @@ public function select() {
$select[] = $field['clause'];
// FIXME: dirty hack for setting columnHeaders
- $this->_columnHeaders["{$field['alias']}_{$field['name']}_sum"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$field['alias']}_{$field['name']}_sum"]['type'] = $field['type'] ?? NULL;
$this->_columnHeaders["{$field['alias']}_{$field['name']}_sum"]['title'] = $field['title'];
- $this->_columnHeaders["{$field['alias']}_{$field['name']}_count"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$field['alias']}_{$field['name']}_count"]['type'] = $field['type'] ?? NULL;
$this->_columnHeaders["{$field['alias']}_{$field['name']}_count"]['title'] = $field['title'];
continue;
}
// only include statistics columns if set
$select[] = "{$field['dbAlias']} as {$field['alias']}_{$field['name']}";
- $this->_columnHeaders["{$field['alias']}_{$field['name']}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$field['alias']}_{$field['name']}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$field['alias']}_{$field['name']}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$field['alias']}_{$field['name']}"]['title'] = $field['title'] ?? NULL;
if (!empty($field['no_display'])) {
$this->_columnHeaders["{$field['alias']}_{$field['name']}"]['no_display'] = TRUE;
}
@@ -386,14 +386,14 @@ public function whereContribution($replaceAliasWith = 'contribution1') {
foreach ($this->_columns['civicrm_contribution']['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
@@ -450,7 +450,7 @@ public function where() {
) {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php
index b50437689089..c4c2d371486d 100644
--- a/CRM/Report/Form/Contribute/SoftCredit.php
+++ b/CRM/Report/Form/Contribute/SoftCredit.php
@@ -369,7 +369,7 @@ public function select() {
}
else {
$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'];
}
}
diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php
index 5a4de704343b..35df8417748e 100644
--- a/CRM/Report/Form/Contribute/Summary.php
+++ b/CRM/Report/Form/Contribute/Summary.php
@@ -423,8 +423,8 @@ public function select() {
}
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
@@ -580,7 +580,7 @@ public function storeWhereHavingClauseArray() {
public function statistics(&$rows) {
$statistics = parent::statistics($rows);
- $softCredit = CRM_Utils_Array::value('soft_amount', $this->_params['fields']);
+ $softCredit = $this->_params['fields']['soft_amount'] ?? NULL;
$onlySoftCredit = $softCredit && !CRM_Utils_Array::value('total_amount', $this->_params['fields']);
if (!isset($this->_groupByArray['civicrm_contribution_currency'])) {
$this->_groupByArray['civicrm_contribution_currency'] = 'currency';
diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php
index 37c1385be4dd..ec142d1a4a31 100644
--- a/CRM/Report/Form/Contribute/Sybunt.php
+++ b/CRM/Report/Form/Contribute/Sybunt.php
@@ -294,7 +294,7 @@ public function select() {
}
else {
$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'];
}
if (!empty($field['no_display'])) {
@@ -341,16 +341,16 @@ public function where() {
}
elseif (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php
index a73a3e42e88b..a3329a928f00 100644
--- a/CRM/Report/Form/Contribute/TopDonor.php
+++ b/CRM/Report/Form/Contribute/TopDonor.php
@@ -204,8 +204,8 @@ public function __construct() {
public static function formRule($fields, $files, $self) {
$errors = [];
- $op = CRM_Utils_Array::value('total_range_op', $fields);
- $val = CRM_Utils_Array::value('total_range_value', $fields);
+ $op = $fields['total_range_op'] ?? NULL;
+ $val = $fields['total_range_value'] ?? NULL;
if (!in_array($op, [
'eq',
@@ -244,16 +244,16 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
@@ -266,7 +266,7 @@ public function where() {
if (!empty($clause)) {
if ($fieldName == 'total_range') {
- $value = CRM_Utils_Array::value("total_range_value", $this->_params);
+ $value = $this->_params["total_range_value"] ?? NULL;
$this->_outerCluase = " WHERE (( @rows := @rows + 1) <= {$value}) ";
$this->_groupLimit = " LIMIT {$value}";
}
diff --git a/CRM/Report/Form/Event/IncomeCountSummary.php b/CRM/Report/Form/Event/IncomeCountSummary.php
index a6b154d5cbb8..fea8a0de4b16 100644
--- a/CRM/Report/Form/Event/IncomeCountSummary.php
+++ b/CRM/Report/Form/Event/IncomeCountSummary.php
@@ -179,7 +179,7 @@ public function select() {
}
else {
$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'];
}
}
@@ -210,16 +210,16 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Event/ParticipantListCount.php b/CRM/Report/Form/Event/ParticipantListCount.php
index f1ea17adec16..31a0f70ab16e 100644
--- a/CRM/Report/Form/Event/ParticipantListCount.php
+++ b/CRM/Report/Form/Event/ParticipantListCount.php
@@ -406,7 +406,7 @@ public function select() {
}
else {
$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'];
}
}
diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php
index 9b4c6f719dab..50175c9aaf5b 100644
--- a/CRM/Report/Form/Event/ParticipantListing.php
+++ b/CRM/Report/Form/Event/ParticipantListing.php
@@ -446,16 +446,16 @@ public function select() {
}
$alias = "{$tableName}_{$fieldName}";
$select[] = "{$field['dbAlias']} as $alias";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
$this->_selectAliases[] = $alias;
}
}
}
}
//add blank column at the end
- $blankcols = CRM_Utils_Array::value('blank_column_end', $this->_params);
+ $blankcols = $this->_params['blank_column_end'] ?? NULL;
if ($blankcols) {
for ($i = 1; $i <= $blankcols; $i++) {
$select[] = " '' as blankColumnEnd_{$i}";
@@ -537,19 +537,19 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($fieldName == 'rid') {
- $value = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
+ $value = $this->_params["{$fieldName}_value"] ?? NULL;
if (!empty($value)) {
$operator = '';
if ($op == 'notin') {
@@ -704,9 +704,9 @@ public function alterDisplay(&$rows) {
}
// Convert display name to link
- $displayName = CRM_Utils_Array::value('civicrm_contact_sort_name_linked', $row);
- $cid = CRM_Utils_Array::value('civicrm_contact_id', $row);
- $id = CRM_Utils_Array::value('civicrm_participant_participant_record', $row);
+ $displayName = $row['civicrm_contact_sort_name_linked'] ?? NULL;
+ $cid = $row['civicrm_contact_id'] ?? NULL;
+ $id = $row['civicrm_participant_participant_record'] ?? NULL;
if ($displayName && $cid && $id) {
$url = CRM_Report_Utils_Report::getNextUrl('contact/detail',
diff --git a/CRM/Report/Form/Event/Summary.php b/CRM/Report/Form/Event/Summary.php
index f2dd872e5180..11af2ed73a54 100644
--- a/CRM/Report/Form/Event/Summary.php
+++ b/CRM/Report/Form/Event/Summary.php
@@ -125,16 +125,16 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
@@ -239,8 +239,8 @@ public function buildColumnHeaders() {
!empty($this->_params['fields'][$fieldName])
) {
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
@@ -328,7 +328,7 @@ public function buildChart(&$rows) {
$countEvent = NULL;
if (!empty($this->_params['charts'])) {
foreach ($rows as $key => $value) {
- $graphRows['totalAmount'][] = $graphRows['value'][] = CRM_Utils_Array::value('totalAmount', $rows[$key]);
+ $graphRows['totalAmount'][] = $graphRows['value'][] = $rows[$key]['totalAmount'] ?? NULL;
$graphRows[$this->_interval][] = substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
$rows[$key]['civicrm_event_id'] . ") ";
}
diff --git a/CRM/Report/Form/Grant/Statistics.php b/CRM/Report/Form/Grant/Statistics.php
index da70f8df1f15..c78048f9f60b 100644
--- a/CRM/Report/Form/Grant/Statistics.php
+++ b/CRM/Report/Form/Grant/Statistics.php
@@ -200,8 +200,8 @@ public function select() {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
}
}
@@ -239,16 +239,16 @@ public function where() {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if (($fieldName == 'grant_report_received') &&
(CRM_Utils_Array::value("{$fieldName}_value", $this->_params) ===
0)
@@ -380,7 +380,7 @@ public function alterDisplay(&$rows) {
}
if (!empty($values['civicrm_grant_grant_type_id'])) {
- $grantType = CRM_Utils_Array::value($values['civicrm_grant_grant_type_id'], $grantTypes);
+ $grantType = $grantTypes[$values['civicrm_grant_grant_type_id']] ?? NULL;
$grantStatistics['civicrm_grant_grant_type_id']['title'] = ts('By Grant Type');
self::getStatistics($grantStatistics['civicrm_grant_grant_type_id'], $grantType, $values,
$awardedGrants, $awardedGrantsAmount
@@ -388,7 +388,7 @@ public function alterDisplay(&$rows) {
}
if (array_key_exists('civicrm_worldregion_name', $values)) {
- $region = CRM_Utils_Array::value('civicrm_worldregion_name', $values);
+ $region = $values['civicrm_worldregion_name'] ?? NULL;
$region = ($region) ? $region : 'Unassigned';
$grantStatistics['civicrm_worldregion_name']['title'] = ts('By Region');
self::getStatistics($grantStatistics['civicrm_worldregion_name'], $region, $values,
@@ -397,7 +397,7 @@ public function alterDisplay(&$rows) {
}
if (array_key_exists('civicrm_address_country_id', $values)) {
- $country = CRM_Utils_Array::value($values['civicrm_address_country_id'], $countries);
+ $country = $countries[$values['civicrm_address_country_id']] ?? NULL;
$country = ($country) ? $country : 'Unassigned';
$grantStatistics['civicrm_address_country_id']['title'] = ts('By Country');
self::getStatistics($grantStatistics['civicrm_address_country_id'], $country, $values,
@@ -414,7 +414,7 @@ public function alterDisplay(&$rows) {
}
if (array_key_exists('civicrm_contact_gender_id', $values)) {
- $genderLabel = CRM_Utils_Array::value($values['civicrm_contact_gender_id'], $gender);
+ $genderLabel = $gender[$values['civicrm_contact_gender_id']] ?? NULL;
$genderLabel = ($genderLabel) ? $genderLabel : 'Unassigned';
$grantStatistics['civicrm_contact_gender_id']['title'] = ts('By Gender');
self::getStatistics($grantStatistics['civicrm_contact_gender_id'], $genderLabel, $values,
@@ -424,7 +424,7 @@ public function alterDisplay(&$rows) {
foreach ($values as $customField => $customValue) {
if (strstr($customField, 'civicrm_value_')) {
- $customFieldTitle = CRM_Utils_Array::value('title', $this->_columnHeaders[$customField]);
+ $customFieldTitle = $this->_columnHeaders[$customField]['title'] ?? NULL;
$customGroupTitle = explode('_custom', strstr($customField, 'civicrm_value_'));
$customGroupTitle = $this->_columns[$customGroupTitle[0]]['group_title'];
$grantStatistics[$customGroupTitle]['title'] = ts('By %1', [1 => $customGroupTitle]);
diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php
index 4ca1b81ad2e1..8aa9d4674ca3 100644
--- a/CRM/Report/Form/Instance.php
+++ b/CRM/Report/Form/Instance.php
@@ -239,7 +239,7 @@ public static function setDefaultValues(&$form, &$defaults) {
if ($instanceID) {
// this is already retrieved via Form.php
- $defaults['description'] = CRM_Utils_Array::value('description', $defaults);
+ $defaults['description'] = $defaults['description'] ?? NULL;
if (!empty($defaults['header'])) {
$defaults['report_header'] = $defaults['header'];
}
@@ -258,7 +258,7 @@ public static function setDefaultValues(&$form, &$defaults) {
$params = ['id' => $defaults['navigation_id']];
CRM_Core_BAO_Navigation::retrieve($params, $navigationDefaults);
$defaults['is_navigation'] = 1;
- $defaults['parent_id'] = CRM_Utils_Array::value('parent_id', $navigationDefaults);
+ $defaults['parent_id'] = $navigationDefaults['parent_id'] ?? NULL;
if (!empty($navigationDefaults['is_active'])) {
$form->assign('is_navigation', TRUE);
}
diff --git a/CRM/Report/Form/Mailing/Bounce.php b/CRM/Report/Form/Mailing/Bounce.php
index 5a16a9d90f16..cfb798c179f9 100644
--- a/CRM/Report/Form/Mailing/Bounce.php
+++ b/CRM/Report/Form/Mailing/Bounce.php
@@ -271,9 +271,9 @@ public function select() {
}
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
@@ -337,14 +337,14 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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($this->_aliases[$tableName] . '.' . $field['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
diff --git a/CRM/Report/Form/Mailing/Clicks.php b/CRM/Report/Form/Mailing/Clicks.php
index e8cf3258f583..bc96f7f9e35a 100644
--- a/CRM/Report/Form/Mailing/Clicks.php
+++ b/CRM/Report/Form/Mailing/Clicks.php
@@ -229,9 +229,9 @@ public function select() {
}
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
diff --git a/CRM/Report/Form/Mailing/Detail.php b/CRM/Report/Form/Mailing/Detail.php
index 55b97ffef4d8..5eab237061e2 100644
--- a/CRM/Report/Form/Mailing/Detail.php
+++ b/CRM/Report/Form/Mailing/Detail.php
@@ -279,17 +279,17 @@ public function select() {
'reply_id',
])) {
$select[] = "IF({$field['dbAlias']} IS NULL, 'No', 'Yes') as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
unset($this->_columns[$tableName]['fields'][$fieldName]);
$columns[$tableName][$fieldName] = $field;
}
elseif ($fieldName == 'delivery_id') {
$select[] = "IF(mailing_event_bounce_civireport.id IS NOT NULL, 'Bounced', IF(mailing_event_delivered_civireport.id IS NOT NULL, 'Successful', 'Unknown')) as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
unset($this->_columns[$tableName]['fields'][$fieldName]);
$columns[$tableName][$fieldName] = $field;
}
diff --git a/CRM/Report/Form/Mailing/Opened.php b/CRM/Report/Form/Mailing/Opened.php
index 3bbba7bcd846..5db163b7eb4c 100644
--- a/CRM/Report/Form/Mailing/Opened.php
+++ b/CRM/Report/Form/Mailing/Opened.php
@@ -218,9 +218,9 @@ public function select() {
}
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = $field['no_display'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php
index 7d9fdc621511..4289f9020bea 100644
--- a/CRM/Report/Form/Mailing/Summary.php
+++ b/CRM/Report/Form/Mailing/Summary.php
@@ -356,7 +356,7 @@ public function select() {
$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'];
}
}
@@ -410,14 +410,14 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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($this->_aliases[$tableName] . '.' . $field['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
if ($fieldName == 'relationship_type_id') {
diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php
index 6b4ae72b4f0b..ff38b8cdf61f 100644
--- a/CRM/Report/Form/Member/ContributionDetail.php
+++ b/CRM/Report/Form/Member/ContributionDetail.php
@@ -406,15 +406,15 @@ public function select() {
elseif ($fieldName == 'first_donation_date' ||
$fieldName == 'first_donation_amount'
) {
- $baseField = CRM_Utils_Array::value('base_field', $field);
+ $baseField = $field['base_field'] ?? NULL;
$select[] = "{$this->_aliases['civicrm_contribution']}.{$baseField} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
}
}
@@ -640,8 +640,8 @@ public function alterDisplay(&$rows) {
if (array_key_exists('fields', $table)) {
foreach ($table['fields'] as $fieldName => $field) {
if (!empty($field['csv_display']) && !empty($field['no_display'])) {
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
}
}
}
@@ -716,7 +716,7 @@ public function alterDisplay(&$rows) {
}
if (!empty($row['civicrm_batch_batch_id'])) {
- $rows[$rowNum]['civicrm_batch_batch_id'] = CRM_Utils_Array::value($row['civicrm_batch_batch_id'], $batches);
+ $rows[$rowNum]['civicrm_batch_batch_id'] = $batches[$row['civicrm_batch_batch_id']] ?? NULL;
$entryFound = TRUE;
}
diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php
index 5f1c54e5c6ef..acdb9a16b0a9 100644
--- a/CRM/Report/Form/Member/Lapse.php
+++ b/CRM/Report/Form/Member/Lapse.php
@@ -173,7 +173,7 @@ public function select() {
!empty($this->_params['fields'][$fieldName])
) {
$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'];
}
}
@@ -223,16 +223,16 @@ public function where() {
$clause = NULL;
if ($field['operatorType'] & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php
index 936b68493c70..1bd21077b7ca 100644
--- a/CRM/Report/Form/Member/Summary.php
+++ b/CRM/Report/Form/Member/Summary.php
@@ -272,12 +272,12 @@ public function select() {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
}
$this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'];
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['operatorType'] = CRM_Utils_Array::value('operatorType', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['operatorType'] = $field['operatorType'] ?? NULL;
}
else {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
$this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'];
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['operatorType'] = CRM_Utils_Array::value('operatorType', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['operatorType'] = $field['operatorType'] ?? NULL;
}
}
}
@@ -446,8 +446,8 @@ public function buildChart(&$rows) {
$graphRows = [];
$count = 0;
$membershipTypeValues = CRM_Member_PseudoConstant::membershipType();
- $isMembershipType = CRM_Utils_Array::value('membership_type_id', $this->_params['group_bys']);
- $isJoiningDate = CRM_Utils_Array::value('join_date', $this->_params['group_bys']);
+ $isMembershipType = $this->_params['group_bys']['membership_type_id'] ?? NULL;
+ $isJoiningDate = $this->_params['group_bys']['join_date'] ?? NULL;
if (!empty($this->_params['charts'])) {
foreach ($rows as $key => $row) {
if (!($row['civicrm_membership_join_date_subtotal'] &&
@@ -457,8 +457,8 @@ public function buildChart(&$rows) {
continue;
}
if ($isMembershipType) {
- $join_date = CRM_Utils_Array::value('civicrm_membership_join_date_start', $row);
- $displayInterval = CRM_Utils_Array::value('civicrm_membership_join_date_interval', $row);
+ $join_date = $row['civicrm_membership_join_date_start'] ?? NULL;
+ $displayInterval = $row['civicrm_membership_join_date_interval'] ?? NULL;
if ($join_date) {
list($year, $month) = explode('-', $join_date);
}
@@ -493,8 +493,8 @@ public function buildChart(&$rows) {
$display[$membershipType] = $row['civicrm_contribution_total_amount_sum'];
}
else {
- $graphRows['receive_date'][] = CRM_Utils_Array::value('civicrm_membership_join_date_start', $row);
- $graphRows[$this->_interval][] = CRM_Utils_Array::value('civicrm_membership_join_date_interval', $row);
+ $graphRows['receive_date'][] = $row['civicrm_membership_join_date_start'] ?? NULL;
+ $graphRows[$this->_interval][] = $row['civicrm_membership_join_date_interval'] ?? NULL;
$graphRows['value'][] = $row['civicrm_contribution_total_amount_sum'];
$count++;
}
diff --git a/CRM/Report/Form/Membership/Summary.php b/CRM/Report/Form/Membership/Summary.php
index 25a5417448af..ddceca33870d 100644
--- a/CRM/Report/Form/Membership/Summary.php
+++ b/CRM/Report/Form/Membership/Summary.php
@@ -182,16 +182,16 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if ($field['type'] & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php
index cb015c8123fc..d8e66c78e5ea 100644
--- a/CRM/Report/Form/Pledge/Detail.php
+++ b/CRM/Report/Form/Pledge/Detail.php
@@ -331,16 +331,16 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Pledge/Pbnp.php b/CRM/Report/Form/Pledge/Pbnp.php
index 66eb610655a5..e9b97fbf07be 100644
--- a/CRM/Report/Form/Pledge/Pbnp.php
+++ b/CRM/Report/Form/Pledge/Pbnp.php
@@ -181,8 +181,8 @@ public function select() {
!empty($this->_params['fields'][$fieldName])
) {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field);
- $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field);
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = $field['type'] ?? NULL;
+ $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $field['title'] ?? NULL;
}
}
}
diff --git a/CRM/Report/Form/Pledge/Summary.php b/CRM/Report/Form/Pledge/Summary.php
index 10ae20e55011..0adf1b860cd3 100644
--- a/CRM/Report/Form/Pledge/Summary.php
+++ b/CRM/Report/Form/Pledge/Summary.php
@@ -309,16 +309,16 @@ public function where() {
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_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;
if ($relative || $from || $to) {
$clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
}
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Form/Walklist/Walklist.php b/CRM/Report/Form/Walklist/Walklist.php
index 152799859e6a..14b40773b37a 100644
--- a/CRM/Report/Form/Walklist/Walklist.php
+++ b/CRM/Report/Form/Walklist/Walklist.php
@@ -119,14 +119,14 @@ public function where() {
$clause = NULL;
if ($field['type'] & CRM_Utils_Type::T_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['name'], $relative, $from, $to, $field['type']);
}
else {
- $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
+ $op = $this->_params["{$fieldName}_op"] ?? NULL;
if ($op) {
$clause = $this->whereClause($field,
$op,
diff --git a/CRM/Report/Utils/Get.php b/CRM/Report/Utils/Get.php
index e0498dbab766..59cfbf7c4e95 100644
--- a/CRM/Report/Utils/Get.php
+++ b/CRM/Report/Utils/Get.php
@@ -25,7 +25,7 @@ class CRM_Report_Utils_Get {
* @return mixed|null
*/
public static function getTypedValue($name, $type) {
- $value = CRM_Utils_Array::value($name, $_GET);
+ $value = $_GET[$name] ?? NULL;
if ($value === NULL) {
return NULL;
}
@@ -188,7 +188,7 @@ public static function intParam($fieldName, &$field, &$defaults) {
* @param $defaults
*/
public static function processChart(&$defaults) {
- $chartType = CRM_Utils_Array::value("charts", $_GET);
+ $chartType = $_GET["charts"] ?? NULL;
if (in_array($chartType, [
'barChart',
'pieChart',
diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php
index 329bf0f83575..1cc6cc7d1879 100644
--- a/CRM/Report/Utils/Report.php
+++ b/CRM/Report/Utils/Report.php
@@ -188,9 +188,9 @@ public static function mailReport($fileContent, $instanceID = NULL, $outputMode
$params['from'] = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
//$domainEmailName;
$params['toName'] = "";
- $params['toEmail'] = CRM_Utils_Array::value('email_to', $instanceInfo);
- $params['cc'] = CRM_Utils_Array::value('email_cc', $instanceInfo);
- $params['subject'] = CRM_Utils_Array::value('email_subject', $instanceInfo);
+ $params['toEmail'] = $instanceInfo['email_to'] ?? NULL;
+ $params['cc'] = $instanceInfo['email_cc'] ?? NULL;
+ $params['subject'] = $instanceInfo['email_subject'] ?? NULL;
if (empty($instanceInfo['attachments'])) {
$instanceInfo['attachments'] = [];
}
@@ -251,7 +251,7 @@ public static function makeCsv(&$form, &$rows) {
$value = NULL;
foreach ($rows as $row) {
foreach ($columnHeaders as $k => $v) {
- $value = CRM_Utils_Array::value($v, $row);
+ $value = $row[$v] ?? NULL;
if (isset($value)) {
// Remove HTML, unencode entities, and escape quotation marks.
$value = str_replace('"', '""', html_entity_decode(strip_tags($value)));
@@ -395,7 +395,7 @@ public static function isInstanceGroupRoleAllowed($instanceId) {
* @return array
*/
public static function processReport($params) {
- $instanceId = CRM_Utils_Array::value('instanceId', $params);
+ $instanceId = $params['instanceId'] ?? NULL;
// hack for now, CRM-8358
$_REQUEST['instanceId'] = $instanceId;
@@ -502,7 +502,7 @@ public static function getPreviewCriteriaQueryParams($defaults = [], $params = [
// (e.g., values for 'nll' and 'nnll' ops are blank),
// so store them temporarily and examine below.
$string_values[$basename] = $field_value;
- $op_values[$basename] = CRM_Utils_Array::value("{$basename}_op", $params);
+ $op_values[$basename] = $params["{$basename}_op"] ?? NULL;
}
elseif ($suffix == '_op') {
// These filters can have an effect even without a value
diff --git a/CRM/SMS/BAO/Provider.php b/CRM/SMS/BAO/Provider.php
index 4e046f743390..b2c2e45e2267 100644
--- a/CRM/SMS/BAO/Provider.php
+++ b/CRM/SMS/BAO/Provider.php
@@ -78,7 +78,7 @@ public static function getProviders($selectArr = NULL, $filter = NULL, $getActiv
* @return array saved values
*/
public static function create(&$params) {
- $id = CRM_Utils_Array::value('id', $params);
+ $id = $params['id'] ?? NULL;
if ($id) {
CRM_Utils_Hook::pre('edit', 'SmsProvider', $id, $params);
diff --git a/CRM/SMS/Form/Group.php b/CRM/SMS/Form/Group.php
index 7aae52fb1b97..4a53b78852a8 100644
--- a/CRM/SMS/Form/Group.php
+++ b/CRM/SMS/Form/Group.php
@@ -71,7 +71,7 @@ public function setDefaultValues() {
}
$defaults['includeGroups'] = $mailingGroups['civicrm_group']['Include'];
- $defaults['excludeGroups'] = CRM_Utils_Array::value('Exclude', $mailingGroups['civicrm_group']);
+ $defaults['excludeGroups'] = $mailingGroups['civicrm_group']['Exclude'] ?? NULL;
$defaults['includeMailings'] = CRM_Utils_Array::value('Include', CRM_Utils_Array::value('civicrm_mailing', $mailingGroups));
$defaults['excludeMailings'] = CRM_Utils_Array::value('Exclude', CRM_Utils_Array::value('civicrm_mailing', $mailingGroups));
diff --git a/CRM/SMS/Form/Upload.php b/CRM/SMS/Form/Upload.php
index 922b2812257e..e9d2efb31143 100644
--- a/CRM/SMS/Form/Upload.php
+++ b/CRM/SMS/Form/Upload.php
@@ -227,7 +227,7 @@ public function postProcess() {
$params['msg_template_id'] = $msgTemplate->id;
}
else {
- $params['msg_template_id'] = CRM_Utils_Array::value('SMStemplate', $formValues);
+ $params['msg_template_id'] = $formValues['SMStemplate'] ?? NULL;
}
$this->set('template', $params['msg_template_id']);
}
@@ -299,7 +299,7 @@ public static function formRule($params, $files, $self) {
}
else {
if (!empty($params['text_message'])) {
- $messageCheck = CRM_Utils_Array::value('text_message', $params);
+ $messageCheck = $params['text_message'] ?? NULL;
if ($messageCheck && (strlen($messageCheck) > CRM_SMS_Provider::MAX_SMS_CHAR)) {
$errors['text_message'] = ts("You can configure the SMS message body up to %1 characters", [1 => CRM_SMS_Provider::MAX_SMS_CHAR]);
}
diff --git a/CRM/SMS/Provider.php b/CRM/SMS/Provider.php
index 18976e184865..387092876d51 100644
--- a/CRM/SMS/Provider.php
+++ b/CRM/SMS/Provider.php
@@ -35,9 +35,9 @@ abstract class CRM_SMS_Provider {
* @throws CRM_Core_Exception
*/
public static function &singleton($providerParams = array(), $force = FALSE) {
- $mailingID = CRM_Utils_Array::value('mailing_id', $providerParams);
- $providerID = CRM_Utils_Array::value('provider_id', $providerParams);
- $providerName = CRM_Utils_Array::value('provider', $providerParams);
+ $mailingID = $providerParams['mailing_id'] ?? NULL;
+ $providerID = $providerParams['provider_id'] ?? NULL;
+ $providerName = $providerParams['provider'] ?? NULL;
if (!$providerID && $mailingID) {
$providerID = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $mailingID, 'sms_provider_id', 'id');
@@ -141,7 +141,7 @@ public function createActivity($apiMsgID, $message, $headers = array(), $jobID =
}
if (!$sourceContactID) {
- $sourceContactID = CRM_Utils_Array::value('Contact', $headers);
+ $sourceContactID = $headers['Contact'] ?? NULL;
}
if (!$sourceContactID) {
return FALSE;
diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php
index 5e7247049cb1..4476ef73038f 100644
--- a/CRM/UF/Form/Field.php
+++ b/CRM/UF/Form/Field.php
@@ -140,7 +140,7 @@ public function preProcess() {
continue;
}
$this->_selectFields[$name] = $field['title'];
- $this->_hasLocationTypes[$name] = CRM_Utils_Array::value('hasLocationType', $field);
+ $this->_hasLocationTypes[$name] = $field['hasLocationType'] ?? NULL;
}
// lets add group, tag and current_employer to this list
@@ -187,7 +187,7 @@ public function buildQuickForm() {
CRM_Core_BAO_UFField::retrieve($params, $defaults);
// set it to null if so (avoids crappy E_NOTICE errors below
- $defaults['location_type_id'] = CRM_Utils_Array::value('location_type_id', $defaults);
+ $defaults['location_type_id'] = $defaults['location_type_id'] ?? NULL;
//CRM-20861 - Include custom fields defined for address to set its default location type to 0.
$specialFields = array_merge(CRM_Core_BAO_UFGroup::getLocationFields(), $addressCustomFields);
@@ -245,8 +245,8 @@ public function buildQuickForm() {
else {
$this->_mapperFields[$key][$key1] = $value1['title'];
}
- $hasLocationTypes[$key][$key1] = CRM_Utils_Array::value('hasLocationType', $value1);
- $hasWebsiteTypes[$key][$key1] = CRM_Utils_Array::value('hasWebsiteType', $value1);
+ $hasLocationTypes[$key][$key1] = $value1['hasLocationType'] ?? NULL;
+ $hasWebsiteTypes[$key][$key1] = $value1['hasWebsiteType'] ?? NULL;
// hide the 'is searchable' field for 'File' custom data
if (isset($value1['data_type']) &&
isset($value1['html_type']) &&
@@ -700,7 +700,7 @@ public static function formRulePrimaryCheck($fields, $profileFieldName, $groupFi
if (array_key_exists($profileFieldName, $checkPrimary)) {
$whereCheck = $checkPrimary[$profileFieldName];
}
- $potentialLocationType = CRM_Utils_Array::value(2, $fields['field_name']);
+ $potentialLocationType = $fields['field_name'][2] ?? NULL;
if ($whereCheck && $potentialLocationType == 0) {
$primaryOfSameTypeFound = '';
@@ -761,7 +761,7 @@ public static function formRule($fields, $files, $self) {
}
$isCustomField = FALSE;
- $profileFieldName = CRM_Utils_Array::value(1, $fields['field_name']);
+ $profileFieldName = $fields['field_name'][1] ?? NULL;
if ($profileFieldName) {
//get custom field id
$customFieldId = explode('_', $profileFieldName);
diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php
index 90f7528c4973..4aba5aea9745 100644
--- a/CRM/UF/Form/Group.php
+++ b/CRM/UF/Form/Group.php
@@ -264,8 +264,8 @@ public function setDefaultValues() {
$params = ['id' => $this->_id];
CRM_Core_BAO_UFGroup::retrieve($params, $defaults);
- $defaults['group'] = CRM_Utils_Array::value('limit_listings_group_id', $defaults);
- $defaults['add_contact_to_group'] = CRM_Utils_Array::value('add_to_group_id', $defaults);
+ $defaults['group'] = $defaults['limit_listings_group_id'] ?? NULL;
+ $defaults['add_contact_to_group'] = $defaults['add_to_group_id'] ?? NULL;
//get the uf join records for current uf group
$ufJoinRecords = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id);
foreach ($ufJoinRecords as $key => $value) {
diff --git a/CRM/UF/Page/Group.php b/CRM/UF/Page/Group.php
index 6e74e8d79b65..764e5355e832 100644
--- a/CRM/UF/Page/Group.php
+++ b/CRM/UF/Page/Group.php
@@ -464,7 +464,7 @@ public static function extractGroupTypes($groupType) {
foreach ($valueParts as $val) {
if (CRM_Utils_Rule::integer($val)) {
- $groupTypeValues[$val] = CRM_Utils_Array::value($val, $valueLabels);
+ $groupTypeValues[$val] = $valueLabels[$val] ?? NULL;
}
}
diff --git a/CRM/Upgrade/Incremental/php/FourFive.php b/CRM/Upgrade/Incremental/php/FourFive.php
index 4925552c20ea..d905ea536b06 100644
--- a/CRM/Upgrade/Incremental/php/FourFive.php
+++ b/CRM/Upgrade/Incremental/php/FourFive.php
@@ -331,7 +331,7 @@ public static function updateSavedSearch(CRM_Queue_TaskContext $ctx) {
if (count($data_value) == 0 && $op == 'or') {
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($fieldID);
foreach ($customOption as $option) {
- $data_value[] = CRM_Utils_Array::value('value', $option);
+ $data_value[] = $option['value'] ?? NULL;
}
}
diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php
index 6e1eb1c61bde..90163f011747 100644
--- a/CRM/Utils/Address.php
+++ b/CRM/Utils/Address.php
@@ -59,7 +59,7 @@ public static function format(
$formatted = $format;
- $fullPostalCode = CRM_Utils_Array::value('postal_code', $fields);
+ $fullPostalCode = $fields['postal_code'] ?? NULL;
if (!empty($fields['postal_code_suffix'])) {
$fullPostalCode .= "-$fields[postal_code_suffix]";
}
@@ -194,7 +194,7 @@ public static function format(
// also sub all token fields
if ($tokenFields) {
foreach ($tokenFields as $token) {
- $replacements["{$token}"] = CRM_Utils_Array::value("{$token}", $fields);
+ $replacements["{$token}"] = $fields["{$token}"] ?? NULL;
}
}
@@ -320,7 +320,7 @@ public static function getFormattedBillingAddressFieldsFromParameters($params, $
$addressFields = [];
foreach ($addressParts as $name => $field) {
- $value = CRM_Utils_Array::value($field, $params);
+ $value = $params[$field] ?? NULL;
$alternateName = 'billing_' . $name . '_id-' . $billingLocationTypeID;
$alternate2 = 'billing_' . $name . '-' . $billingLocationTypeID;
if (isset($params[$alternate2]) && !isset($params[$alternateName])) {
diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php
index 1a3d8a002072..a35d321a31eb 100644
--- a/CRM/Utils/Array.php
+++ b/CRM/Utils/Array.php
@@ -915,7 +915,7 @@ public static function filterColumns($matrix, $columns) {
foreach ($matrix as $pos => $oldRow) {
$newRow = [];
foreach ($columns as $column) {
- $newRow[$column] = CRM_Utils_Array::value($column, $oldRow);
+ $newRow[$column] = $oldRow[$column] ?? NULL;
}
$newRows[$pos] = $newRow;
}
diff --git a/CRM/Utils/Chart.php b/CRM/Utils/Chart.php
index 36fa6ea729fd..9a5b90a71c51 100644
--- a/CRM/Utils/Chart.php
+++ b/CRM/Utils/Chart.php
@@ -211,8 +211,8 @@ public static function chart($rows, $chart, $interval) {
}
// legend
- $chartData['xname'] = CRM_Utils_Array::value('xname', $rows);
- $chartData['yname'] = CRM_Utils_Array::value('yname', $rows);
+ $chartData['xname'] = $rows['xname'] ?? NULL;
+ $chartData['yname'] = $rows['yname'] ?? NULL;
// carry some chart params if pass.
foreach ([
diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php
index df20858d5b7e..6f597a4401c4 100644
--- a/CRM/Utils/Date.php
+++ b/CRM/Utils/Date.php
@@ -950,12 +950,12 @@ public static function calculateAge($birthDate) {
*/
public static function intervalAdd($unit, $interval, $date, $dontCareTime = FALSE) {
if (is_array($date)) {
- $hour = CRM_Utils_Array::value('H', $date);
- $minute = CRM_Utils_Array::value('i', $date);
- $second = CRM_Utils_Array::value('s', $date);
- $month = CRM_Utils_Array::value('M', $date);
- $day = CRM_Utils_Array::value('d', $date);
- $year = CRM_Utils_Array::value('Y', $date);
+ $hour = $date['H'] ?? NULL;
+ $minute = $date['i'] ?? NULL;
+ $second = $date['s'] ?? NULL;
+ $month = $date['M'] ?? NULL;
+ $day = $date['d'] ?? NULL;
+ $year = $date['Y'] ?? NULL;
}
else {
extract(date_parse($date));
diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php
index 8e62e1e17b21..b6da19bb686f 100644
--- a/CRM/Utils/DeprecatedUtils.php
+++ b/CRM/Utils/DeprecatedUtils.php
@@ -157,8 +157,8 @@ function _civicrm_api3_deprecated_activity_formatted_param(&$params, &$values, $
elseif ($type == 'Select' || $type == 'Radio') {
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE);
foreach ($customOption as $customFldID => $customValue) {
- $val = CRM_Utils_Array::value('value', $customValue);
- $label = CRM_Utils_Array::value('label', $customValue);
+ $val = $customValue['value'] ?? NULL;
+ $label = $customValue['label'] ?? NULL;
$label = strtolower($label);
$value = strtolower(trim($value));
if (($value == $label) || ($value == strtolower($val))) {
@@ -434,7 +434,7 @@ function _civicrm_api3_deprecated_add_formatted_param(&$values, &$params) {
// mark an entry in fields array since we want the value of custom field to be copied
$fields['Address'][$key] = NULL;
- $htmlType = CRM_Utils_Array::value('html_type', $customFields[$customFieldID]);
+ $htmlType = $customFields[$customFieldID]['html_type'] ?? NULL;
switch ($htmlType) {
case 'CheckBox':
case 'Multi-Select':
@@ -548,8 +548,8 @@ function _civicrm_api3_deprecated_add_formatted_param(&$values, &$params) {
*