diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index c40672f8530e8c01117c64b4d70f0e7b852b39d6..92702de78290c9848f2d644998c5e558923c64d7 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -617,7 +617,7 @@ class CRM_Activity_BAO_Query { public static function whereClauseSingleActivityText(&$values, &$query) { [$name, $op, $value, $grouping, $wildcard] = $values; $activityOptionValues = $query->getWhereValues('activity_option', $grouping); - $activityOption = CRM_Utils_Array::value(2, $activityOptionValues, 6); + $activityOption = $activityOptionValues[2] ?? 6; $query->_useDistinct = TRUE; diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index c2da15bf7ac607f6d885cc3450bd0a13523be027..998cd52bade2acd07c6c903577d3870684920d45 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4812,7 +4812,8 @@ civicrm_relationship.start_date > {$today} if (!is_array($values)) { return FALSE; } - if (($operator = CRM_Utils_Array::value(1, $values)) == FALSE) { + $operator = $values[1] ?? FALSE; + if (!$operator) { return FALSE; } return in_array($operator, CRM_Core_DAO::acceptedSQLOperators()); diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 9dee169d5f6cc841a5543937a327b44f96a4bfb3..1a63c7a6a2c5d63a81a742e860203edba2681416 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -261,7 +261,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { // on the form. if (substr($element[1], 0, 13) === 'move_location') { $element[4] = array_merge( - (array) CRM_Utils_Array::value(4, $element, []), + (array) ($element[4] ?? []), [ 'data-location' => substr($element[1], 14), 'data-is_location' => TRUE, @@ -270,7 +270,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { if (substr($element[1], 0, 15) === 'location_blocks') { // @todo We could add some data elements here to make jquery manipulation more straight-forward // @todo consider enabling if it is an add & defaulting to true. - $element[4] = array_merge((array) CRM_Utils_Array::value(4, $element, []), ['disabled' => TRUE]); + $element[4] = array_merge((array) ($element[4] ?? []), ['disabled' => TRUE]); } $newCheckBox = $this->addElement($element[0], $element[1], diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 0cb54004a2ebe1a3e75941a6a8b40c0f100f2da8..acaa0d3f123e31f6228e5fcd501858859f8b23cc 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -245,7 +245,7 @@ class CRM_Contact_Page_AJAX { // first check if there is any existing relationship present with same parameters. // If yes then update the relationship by setting active and start date to current time $relationship = civicrm_api3('Relationship', 'get', $params)['values']; - $params = array_merge(CRM_Utils_Array::value(0, $relationship, $params), [ + $params = array_merge($relationship[0] ?? $params, [ 'start_date' => 'now', 'is_active' => TRUE, 'end_date' => '', diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 737931f3e1cda35da2da7091b4e49d41519ac477..24d875af939bce78405f03bf7c419692266d7f33 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -572,7 +572,7 @@ class CRM_Core_Permission { $item['access_callback'][0] == 'CRM_Core_Permission' && $item['access_callback'][1] == 'checkMenu' ) { - $op = CRM_Utils_Array::value(1, $item['access_arguments'], 'and'); + $op = $item['access_arguments'][1] ?? 'and'; return self::checkMenu($item['access_arguments'][0], $op); } else { diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index b3602fdecac144944f7f6d891aa98383f4cfea0b..abcc728ccb8dc5215245333204e84fd68416cf10 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -617,7 +617,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { $primaryParticipantCount = $form->getParticipantCount($ppParams); //get price set fields errors in. - $errors = array_merge($errors, CRM_Utils_Array::value(0, $priceSetErrors, [])); + $errors = array_merge($errors, $priceSetErrors[0] ?? []); $totalParticipants = $primaryParticipantCount; if ($numberAdditionalParticipants) { diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index 80ec7221fab369dbc8bae639d00fda663839e4d9..718a6495a62ec3ca57aef2a21c3ff723957c1217 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -1683,7 +1683,7 @@ class CRM_Export_BAO_ExportProcessor { foreach ($relationValue as $ltype => $val) { foreach (array_keys($val) as $fld) { $type = explode('-', $fld); - $this->addOutputSpecification($type[0], $key, $ltype, CRM_Utils_Array::value(1, $type)); + $this->addOutputSpecification($type[0], $key, $ltype, $type[1] ?? NULL); } } } @@ -1700,7 +1700,7 @@ class CRM_Export_BAO_ExportProcessor { if (!empty($type[1])) { $daoFieldName .= "-" . $type[1]; } - $this->addOutputSpecification($actualDBFieldName, NULL, $locationType, CRM_Utils_Array::value(1, $type)); + $this->addOutputSpecification($actualDBFieldName, NULL, $locationType, $type[1] ?? NULL); $outputColumns[$daoFieldName] = TRUE; } } diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 9e334bab42e1243656ee38264c5f1963ea653182..b1bc3e7757c241c020b5dba54f574d2d3b6f6497 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -550,7 +550,7 @@ class CRM_Utils_REST { $call[0], $call[1], ]; - $output[$key] = self::process($args, CRM_Utils_Array::value(2, $call, [])); + $output[$key] = self::process($args, $call[2] ?? []); } return $output; } diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index 80491b7c28cfbfeb707c67ddbaa690451946271d..f122a28494cc6f57c9cf10a722fdf7847746549b 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -346,7 +346,7 @@ class CRM_Utils_VersionCheck { 'api_action' => "version_check", 'api_entity' => "job", ]); - $this->cronJob = CRM_Utils_Array::value(0, $jobs['values'], []); + $this->cronJob = $jobs['values'][0] ?? []; } }