Replace coalesce pattern with coalesce operator
authorColeman Watts <coleman@civicrm.org>
Mon, 16 Mar 2020 20:47:48 +0000 (16:47 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 17 Mar 2020 13:18:50 +0000 (09:18 -0400)
100 files changed:
CRM/Contact/BAO/Contact/Location.php
CRM/Contact/BAO/Contact/Utils.php
CRM/Contact/BAO/Query.php
CRM/Contact/Form/Contact.php
CRM/Contact/Form/Edit/TagsAndGroups.php
CRM/Contact/Form/Search.php
CRM/Contact/Form/Task/PDFLetterCommon.php
CRM/Contact/Form/Task/Print.php
CRM/Contact/Import/Form/MapField.php
CRM/Contact/Import/ImportJob.php
CRM/Contact/Selector.php
CRM/Contact/Selector/Custom.php
CRM/Contribute/Import/Form/MapField.php
CRM/Contribute/Import/Form/Preview.php
CRM/Contribute/Tokens.php
CRM/Core/BAO/ActionSchedule.php
CRM/Core/BAO/Address.php
CRM/Core/BAO/FinancialTrxn.php
CRM/Core/BAO/Mapping.php
CRM/Core/BAO/UFGroup.php
CRM/Core/Block.php
CRM/Core/Config/MagicMerge.php
CRM/Core/DAO/AllCoreTables.php
CRM/Core/DAO/permissions.php
CRM/Core/Error.php
CRM/Core/Form.php
CRM/Core/Invoke.php
CRM/Core/Page.php
CRM/Core/Page/File.php
CRM/Core/Payment.php
CRM/Core/Payment/Form.php
CRM/Core/Payment/PayPalImpl.php
CRM/Core/Payment/Realex.php
CRM/Core/PrevNextCache/Redis.php
CRM/Core/Region.php
CRM/Core/Smarty.php
CRM/Core/Smarty/plugins/function.crmAttributes.php
CRM/Custom/Form/CustomData.php
CRM/Custom/Page/Group.php
CRM/Event/Form/Participant.php
CRM/Event/Form/Registration/Register.php
CRM/Event/Form/Search.php
CRM/Export/BAO/ExportProcessor.php
CRM/Financial/BAO/PaymentProcessor.php
CRM/Group/Form/Edit.php
CRM/Import/Parser.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/Page/View.php
CRM/Member/BAO/Membership.php
CRM/Member/Form/Task/PDFLetter.php
CRM/Member/Import/Form/MapField.php
CRM/PCP/BAO/PCP.php
CRM/PCP/Form/Campaign.php
CRM/PCP/Form/PCPAccount.php
CRM/Profile/Form.php
CRM/Queue/Runner.php
CRM/Report/BAO/ReportInstance.php
CRM/Report/Form.php
CRM/Report/Form/Case/TimeSpent.php
CRM/UF/Form/Group.php
CRM/Upgrade/Incremental/php/FourSeven.php
CRM/Utils/Array.php
CRM/Utils/Cache/Redis.php
CRM/Utils/Date.php
CRM/Utils/Migrate/Export.php
CRM/Utils/SQL/Delete.php
CRM/Utils/SQL/Select.php
CRM/Utils/String.php
CRM/Utils/System/WordPress.php
CRM/Utils/VersionCheck.php
Civi/API/Provider/ReflectionProvider.php
Civi/Angular/AngularLoader.php
Civi/Api4/Generic/AbstractCreateAction.php
Civi/Api4/Generic/AbstractUpdateAction.php
Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php
Civi/Api4/Service/Spec/SpecFormatter.php
Civi/CiUtil/Command/CompareCommand.php
Civi/Core/CiviEventInspector.php
Civi/Core/Resolver.php
Civi/Core/SettingsBag.php
Civi/Core/SettingsManager.php
Civi/Core/Themes.php
Civi/Core/Transaction/Manager.php
Civi/Test/GenericAssertionsTrait.php
Civi/Test/Schema.php
api/v3/Activity.php
api/v3/Attachment.php
api/v3/CaseContact.php
api/v3/Contact.php
api/v3/EntityTag.php
api/v3/Generic/Getlist.php
api/v3/Profile.php
api/v3/UFGroup.php
bin/cli.class.php
install/civicrm.php
install/index.php
setup/plugins/blocks/requirements.tpl.php
setup/src/Setup/DrupalUtil.php
setup/src/Setup/Model.php
setup/src/Setup/UI/SetupController.php

index 105cbede7844eeeab712b859ab9e0a11cfcb00ed..497cf97768e9f1e89c6b4f7d93c976d762ad65fd 100644 (file)
@@ -184,7 +184,7 @@ AND civicrm_contact.id IN $idString ";
       $location['displayAddress'] = str_replace('<br />', ', ', addslashes($address));
       $location['url'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $dao->contact_id);
       $location['location_type'] = $dao->location_type;
-      $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage(isset($dao->contact_sub_type) ? $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id
+      $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage($dao->contact_sub_type ?? $dao->contact_type, $imageUrlOnly, $dao->contact_id
       );
       $locations[] = $location;
     }
index b32745f6706d4c33c6bfc1ff37af69d2870e587e..3f40464c3b00b7bffcda4657ed99d3197b21331a 100644 (file)
@@ -1081,7 +1081,7 @@ WHERE id IN (" . implode(',', $contactIds) . ")";
       if (!empty($contactParams[$greeting . '_id'])) {
         $string = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Contact', $greeting . '_id', $contactParams[$greeting . '_id']);
       }
-      $string = isset($contactParams[$greeting . '_custom']) ? $contactParams[$greeting . '_custom'] : $string;
+      $string = $contactParams[$greeting . '_custom'] ?? $string;
       if (empty($string)) {
         $tokens[$greeting] = [];
       }
index 93cc504af75469ba3f3deca5edcc555ea71fa12a..8ab6109224de13325ccf69b34dcab834271599a7 100644 (file)
@@ -6407,7 +6407,7 @@ AND   displayRelType.is_active = 1
     foreach ($orderByArray as $orderByClause) {
       $orderByClauseParts = explode(' ', trim($orderByClause));
       $field = $orderByClauseParts[0];
-      $direction = isset($orderByClauseParts[1]) ? $orderByClauseParts[1] : 'asc';
+      $direction = $orderByClauseParts[1] ?? 'asc';
       $fieldSpec = $this->getMetadataForRealField($field);
 
       // This is a hacky add-in for primary address joins. Feel free to iterate as it is unit tested.
@@ -6901,8 +6901,8 @@ AND   displayRelType.is_active = 1
       // This seems to be the only anomaly.
       $fieldName = 'id';
     }
-    $pseudoField = isset($this->_pseudoConstantsSelect[$fieldName]) ? $this->_pseudoConstantsSelect[$fieldName] : [];
-    $field = isset($this->_fields[$fieldName]) ? $this->_fields[$fieldName] : $pseudoField;
+    $pseudoField = $this->_pseudoConstantsSelect[$fieldName] ?? [];
+    $field = $this->_fields[$fieldName] ?? $pseudoField;
     $field = array_merge($field, $pseudoField);
     if (!empty($field) && empty($field['name'])) {
       // standardising field formatting here - over time we can phase out variants.
index fff3ef2c8c704c45739f555829717afd76fbfb39..301a0d895e8851c1dc4cf535ff659c6069651d06 100644 (file)
@@ -501,7 +501,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
           $defaults[$name][$instance]['location_type_id'] = $locationType->id;
         }
         else {
-          $locTypeId = isset($locationTypeKeys[$instance - 1]) ? $locationTypeKeys[$instance - 1] : $locationType->id;
+          $locTypeId = $locationTypeKeys[$instance - 1] ?? $locationType->id;
           $defaults[$name][$instance]['location_type_id'] = $locTypeId;
         }
 
@@ -653,7 +653,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
           if ($name == 'openid' && !empty($blockValues[$name])) {
             $oid = new CRM_Core_DAO_OpenID();
             $oid->openid = $openIds[$instance] = CRM_Utils_Array::value($name, $blockValues);
-            $cid = isset($contactId) ? $contactId : 0;
+            $cid = $contactId ?? 0;
             if ($oid->find(TRUE) && ($oid->contact_id != $cid)) {
               $errors["{$name}[$instance][openid]"] = ts('%1 already exist.', [1 => $blocks['OpenID']]);
             }
index 7096501843d3c151dd2f73e8408ceee66c3ea008..c7d26927153d85cfc8fcd67ed6e781367edfe2a4 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
         $fName = $fieldName;
       }
 
-      $groupID = isset($form->_grid) ? $form->_grid : NULL;
+      $groupID = $form->_grid ?? NULL;
       if ($groupID && $visibility) {
         $ids = [$groupID => $groupID];
       }
index 38b218ab171bc3bbe4d7fed53aca11d73557563c..5c952c7505a30bc24914efd80e22a1cdbd37cdea 100644 (file)
@@ -367,7 +367,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
         $taskParams['deletedContacts'] = CRM_Utils_Array::value('deleted_contacts', $this->_formValues);
       }
       $className = $this->_modeValue['taskClassName'];
-      $taskParams['ssID'] = isset($this->_ssID) ? $this->_ssID : NULL;
+      $taskParams['ssID'] = $this->_ssID ?? NULL;
       $this->_taskList += $className::permissionedTaskTitles(CRM_Core_Permission::getPermission(), $taskParams);
     }
 
index ee7179f2108653f0cc0ef9c43862ef48b9321e99..fddf30a8f99d4630519f34169cc7883fdca879dc 100644 (file)
@@ -110,8 +110,8 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter
   public static function postProcess(&$form) {
     $formValues = $form->controller->exportValues($form->getName());
     list($formValues, $categories, $html_message, $messageToken, $returnProperties) = self::processMessageTemplate($formValues);
-    $skipOnHold = isset($form->skipOnHold) ? $form->skipOnHold : FALSE;
-    $skipDeceased = isset($form->skipDeceased) ? $form->skipDeceased : TRUE;
+    $skipOnHold = $form->skipOnHold ?? FALSE;
+    $skipDeceased = $form->skipDeceased ?? TRUE;
     $html = $activityIds = [];
 
     // CRM-16725 Skip creation of activities if user is previewing their PDF letter(s)
index 65189f345f00d9aa8785c80d08d8947949291325..2869f520a117ab0ee02dcbfea3b4c529a327d609 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task {
     $selectorName = $this->controller->selectorName();
     require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php';
 
-    $returnP = isset($returnProperties) ? $returnProperties : "";
+    $returnP = $returnProperties ?? "";
     $customSearchClass = $this->get('customSearchClass');
     $this->assign('customSearchID', $this->get('customSearchID'));
     $selector = new $selectorName($customSearchClass,
index 7b18995697919258a7d58b9d56e77542bd8baa0a..fa4f236f83f095a0bb05bbb86b3599d3f75892af 100644 (file)
@@ -628,9 +628,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
         $updateMappingFields->column_number = $i;
 
         $mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
-        $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
-        $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
-        $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+        $id = $mapperKeyParts[0] ?? NULL;
+        $first = $mapperKeyParts[1] ?? NULL;
+        $second = $mapperKeyParts[2] ?? NULL;
         if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
           $updateMappingFields->relationship_type_id = $id;
           $updateMappingFields->relationship_direction = "{$first}_{$second}";
@@ -638,14 +638,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
           // get phoneType id and provider id separately
           // before updating mappingFields of phone and IM for related contact, CRM-3140
           if (CRM_Utils_Array::value('1', $mapperKeys[$i]) == 'url') {
-            $updateMappingFields->website_type_id = isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
+            $updateMappingFields->website_type_id = $mapperKeys[$i][2] ?? NULL;
           }
           else {
             if (CRM_Utils_Array::value('1', $mapperKeys[$i]) == 'phone') {
-              $updateMappingFields->phone_type_id = isset($mapperKeys[$i][3]) ? $mapperKeys[$i][3] : NULL;
+              $updateMappingFields->phone_type_id = $mapperKeys[$i][3] ?? NULL;
             }
             elseif (CRM_Utils_Array::value('1', $mapperKeys[$i]) == 'im') {
-              $updateMappingFields->im_provider_id = isset($mapperKeys[$i][3]) ? $mapperKeys[$i][3] : NULL;
+              $updateMappingFields->im_provider_id = $mapperKeys[$i][3] ?? NULL;
             }
             $updateMappingFields->location_type_id = isset($mapperKeys[$i][2]) && is_numeric($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
           }
@@ -657,14 +657,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
           // to store phoneType id and provider id separately
           // before updating mappingFields for phone and IM, CRM-3140
           if (CRM_Utils_Array::value('0', $mapperKeys[$i]) == 'url') {
-            $updateMappingFields->website_type_id = isset($mapperKeys[$i][1]) ? $mapperKeys[$i][1] : NULL;
+            $updateMappingFields->website_type_id = $mapperKeys[$i][1] ?? NULL;
           }
           else {
             if (CRM_Utils_Array::value('0', $mapperKeys[$i]) == 'phone') {
-              $updateMappingFields->phone_type_id = isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
+              $updateMappingFields->phone_type_id = $mapperKeys[$i][2] ?? NULL;
             }
             elseif (CRM_Utils_Array::value('0', $mapperKeys[$i]) == 'im') {
-              $updateMappingFields->im_provider_id = isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
+              $updateMappingFields->im_provider_id = $mapperKeys[$i][2] ?? NULL;
             }
             $locationTypeID = $parserParameters['mapperLocType'][$i];
             // location_type_id is NULL for non-location fields, and for Primary location.
@@ -747,9 +747,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
     $saveMappingFields->column_number = $i;
 
     $mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
-    $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
-    $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
-    $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+    $id = $mapperKeyParts[0] ?? NULL;
+    $first = $mapperKeyParts[1] ?? NULL;
+    $second = $mapperKeyParts[2] ?? NULL;
     if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
       $saveMappingFields->name = ucwords(str_replace("_", " ", $mapperKeys[$i][1]));
       $saveMappingFields->relationship_type_id = $id;
@@ -757,14 +757,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
       // to get phoneType id and provider id separately
       // before saving mappingFields of phone and IM for related contact, CRM-3140
       if (CRM_Utils_Array::value('1', $mapperKeys[$i]) == 'url') {
-        $saveMappingFields->website_type_id = isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
+        $saveMappingFields->website_type_id = $mapperKeys[$i][2] ?? NULL;
       }
       else {
         if (CRM_Utils_Array::value('1', $mapperKeys[$i]) == 'phone') {
-          $saveMappingFields->phone_type_id = isset($mapperKeys[$i][3]) ? $mapperKeys[$i][3] : NULL;
+          $saveMappingFields->phone_type_id = $mapperKeys[$i][3] ?? NULL;
         }
         elseif (CRM_Utils_Array::value('1', $mapperKeys[$i]) == 'im') {
-          $saveMappingFields->im_provider_id = isset($mapperKeys[$i][3]) ? $mapperKeys[$i][3] : NULL;
+          $saveMappingFields->im_provider_id = $mapperKeys[$i][3] ?? NULL;
         }
         $saveMappingFields->location_type_id = (isset($mapperKeys[$i][2]) && $mapperKeys[$i][2] !== 'Primary') ? $mapperKeys[$i][2] : NULL;
       }
@@ -775,14 +775,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
       // to get phoneType id and provider id separately
       // before saving mappingFields of phone and IM, CRM-3140
       if (CRM_Utils_Array::value('0', $mapperKeys[$i]) == 'url') {
-        $saveMappingFields->website_type_id = isset($mapperKeys[$i][1]) ? $mapperKeys[$i][1] : NULL;
+        $saveMappingFields->website_type_id = $mapperKeys[$i][1] ?? NULL;
       }
       else {
         if (CRM_Utils_Array::value('0', $mapperKeys[$i]) == 'phone') {
-          $saveMappingFields->phone_type_id = isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
+          $saveMappingFields->phone_type_id = $mapperKeys[$i][2] ?? NULL;
         }
         elseif (CRM_Utils_Array::value('0', $mapperKeys[$i]) == 'im') {
-          $saveMappingFields->im_provider_id = isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : NULL;
+          $saveMappingFields->im_provider_id = $mapperKeys[$i][2] ?? NULL;
         }
         $saveMappingFields->location_type_id = is_numeric($locationTypeID) ? $locationTypeID : NULL;
       }
index e15f7e3f8696bd1ad5bad3e0873f11869e480806..a29158037e20bc5c7278ab596d78263c85e6747a 100644 (file)
@@ -165,8 +165,8 @@ class CRM_Contact_Import_ImportJob {
 
       $fldNameParts = explode('_', $fldName, 3);
       $id = $fldNameParts[0];
-      $first = isset($fldNameParts[1]) ? $fldNameParts[1] : NULL;
-      $second = isset($fldNameParts[2]) ? $fldNameParts[2] : NULL;
+      $first = $fldNameParts[1] ?? NULL;
+      $second = $fldNameParts[2] ?? NULL;
       if (($first == 'a' && $second == 'b') ||
         ($first == 'b' && $second == 'a')
       ) {
@@ -294,7 +294,7 @@ class CRM_Contact_Import_ImportJob {
 
     if ($newGroupName) {
       /* Create a new group */
-      $newGroupType = isset($newGroupType) ? $newGroupType : array();
+      $newGroupType = $newGroupType ?? array();
       $gParams = array(
         'title' => $newGroupName,
         'description' => $newGroupDesc,
index c0faf5b46331337edd8a21cb10f0a4b3e8ec0b26..1ea2af61da4c896d59b537fa01f9ca7367693d8b 100644 (file)
@@ -719,13 +719,13 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
           list($locType) = explode("-email", $property);
           $onholdProperty = "{$locType}-on_hold";
 
-          $row[$property] = isset($result->$property) ? $result->$property : NULL;
+          $row[$property] = $result->$property ?? NULL;
           if (!empty($row[$property]) && !empty($result->$onholdProperty)) {
             $row[$property] .= " (On Hold)";
           }
         }
         else {
-          $row[$property] = isset($result->$property) ? $result->$property : NULL;
+          $row[$property] = $result->$property ?? NULL;
         }
       }
 
index 1cc1d71bee3d72d804e30ca73b219fadaa68292b..b5ea5468bbc9d57483e6e3507237406aa1d47eca 100644 (file)
@@ -329,7 +329,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
         }
       }
       if (!$empty) {
-        $contactID = isset($dao->contact_id) ? $dao->contact_id : NULL;
+        $contactID = $dao->contact_id ?? NULL;
 
         $row['checkbox'] = CRM_Core_Form::CB_PREFIX . $contactID;
         $row['action'] = CRM_Core_Action::formLink($links,
index b12e24a29ce84f91f8fde44b1aa5fd48c62cd11f..9e0d6479ac26f22280739e5b208fec3f5e3eccfe 100644 (file)
@@ -201,7 +201,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
 
             $mappingHeader = array_keys($this->_mapperFields, $mappingName[$i]);
             // reusing contact_type field array for soft credit
-            $softField = isset($mappingContactType[$i]) ? $mappingContactType[$i] : 0;
+            $softField = $mappingContactType[$i] ?? 0;
 
             if (!$softField) {
               $js .= "{$formName}['mapper[$i][1]'].style.display = 'none';\n";
@@ -338,7 +338,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
       ];
       $params = [
         'used' => 'Unsupervised',
-        'contact_type' => isset($contactTypes[$contactTypeId]) ? $contactTypes[$contactTypeId] : '',
+        'contact_type' => $contactTypes[$contactTypeId] ?? '',
       ];
       list($ruleFields, $threshold) = CRM_Dedupe_BAO_RuleGroup::dedupeRuleFieldsWeight($params);
       $weightSum = 0;
@@ -446,8 +446,8 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
           $softCreditFields[$i] = $mapperSoftCredit[$i];
         }
         $mapperSoftCreditType[$i] = [
-          'value' => isset($mapperKeys[$i][2]) ? $mapperKeys[$i][2] : '',
-          'label' => isset($softCreditTypes[$mapperKeys[$i][2]]) ? $softCreditTypes[$mapperKeys[$i][2]] : '',
+          'value' => $mapperKeys[$i][2] ?? '',
+          'label' => $softCreditTypes[$mapperKeys[$i][2]] ?? '',
         ];
       }
       else {
@@ -483,7 +483,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
         $updateMappingFields->name = $mapper[$i];
 
         //reuse contact_type field in db to store fields associated with soft credit
-        $updateMappingFields->contact_type = isset($mapperSoftCredit[$i]) ? $mapperSoftCredit[$i] : NULL;
+        $updateMappingFields->contact_type = $mapperSoftCredit[$i] ?? NULL;
         $updateMappingFields->save();
       }
     }
@@ -504,7 +504,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
         $saveMappingFields->name = $mapper[$i];
 
         //reuse contact_type field in db to store fields associated with soft credit
-        $saveMappingFields->contact_type = isset($mapperSoftCredit[$i]) ? $mapperSoftCredit[$i] : NULL;
+        $saveMappingFields->contact_type = $mapperSoftCredit[$i] ?? NULL;
         $saveMappingFields->save();
       }
       $this->set('savedMapping', $saveMappingFields->mapping_id);
index aac01eef774da63494f270f5af0bc7c029194cec..b14ea26c39164f444a638baf92cca2b4d1cf524b 100644 (file)
@@ -109,7 +109,7 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
     foreach ($mapper as $key => $value) {
       $mapperKeys[$key] = $mapper[$key][0];
       if (isset($mapper[$key][0]) && $mapper[$key][0] == 'soft_credit' && isset($mapper[$key])) {
-        $mapperSoftCredit[$key] = isset($mapper[$key][1]) ? $mapper[$key][1] : '';
+        $mapperSoftCredit[$key] = $mapper[$key][1] ?? '';
         $mapperSoftCreditType[$key] = $mapperSoftCreditType[$key]['value'];
       }
       else {
index e773317a23f6467f4515773ba3e91be13d968f03..528e15b13a11faa671745e607e1b5dee52e3360d 100644 (file)
@@ -110,7 +110,7 @@ class CRM_Contribute_Tokens extends \Civi\Token\AbstractTokenSubscriber {
    */
   public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) {
     $actionSearchResult = $row->context['actionSearchResult'];
-    $fieldValue = isset($actionSearchResult->{"contrib_$field"}) ? $actionSearchResult->{"contrib_$field"} : NULL;
+    $fieldValue = $actionSearchResult->{"contrib_$field"} ?? NULL;
 
     $aliasTokens = $this->getAliasTokens();
     if (in_array($field, ['total_amount', 'fee_amount', 'net_amount'])) {
index c3d43ac96dc041a49347039da2173b23c8ee88f6..a790d8ad152cd06597f645243cdf29babdf40fe7 100644 (file)
@@ -57,7 +57,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule {
    */
   public static function getMapping($id) {
     $mappings = self::getMappings();
-    return isset($mappings[$id]) ? $mappings[$id] : NULL;
+    return $mappings[$id] ?? NULL;
   }
 
   /**
index 933d1886826b059e80ff1644c4f004f62f513ddd..63ac55c1a6f6bd635ee8bd6183a4f3b88d118fa3 100644 (file)
@@ -121,7 +121,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
   public static function add(&$params, $fixAddress = FALSE) {
 
     $address = new CRM_Core_DAO_Address();
-    $checkPermissions = isset($params['check_permissions']) ? $params['check_permissions'] : TRUE;
+    $checkPermissions = $params['check_permissions'] ?? TRUE;
 
     // fixAddress mode to be done
     if ($fixAddress) {
@@ -548,12 +548,12 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
       'supplemental_address_2' => $this->supplemental_address_2,
       'supplemental_address_3' => $this->supplemental_address_3,
       'city' => $this->city,
-      'state_province_name' => isset($this->state_name) ? $this->state_name : "",
-      'state_province' => isset($this->state) ? $this->state : "",
-      'postal_code' => isset($this->postal_code) ? $this->postal_code : "",
-      'postal_code_suffix' => isset($this->postal_code_suffix) ? $this->postal_code_suffix : "",
-      'country' => isset($this->country) ? $this->country : "",
-      'world_region' => isset($this->world_region) ? $this->world_region : "",
+      'state_province_name' => $this->state_name ?? "",
+      'state_province' => $this->state ?? "",
+      'postal_code' => $this->postal_code ?? "",
+      'postal_code_suffix' => $this->postal_code_suffix ?? "",
+      'country' => $this->country ?? "",
+      'world_region' => $this->world_region ?? "",
     ];
 
     if (isset($this->county_id) && $this->county_id) {
@@ -1033,7 +1033,7 @@ SELECT is_primary,
     }
 
     // Default to TRUE if not set to maintain api backward compatibility.
-    $createRelationship = isset($params['add_relationship']) ? $params['add_relationship'] : TRUE;
+    $createRelationship = $params['add_relationship'] ?? TRUE;
 
     // unset contact id
     $skipFields = ['is_primary', 'location_type_id', 'is_billing', 'contact_id'];
index 4ab15a1d23e29f673cc99fd104db0b6c61263425..d94ff45a1b166f3851ab75d91a772a8969ab57b1 100644 (file)
@@ -184,7 +184,7 @@ LIMIT 1;";
    */
   public static function getRefundTransactionTrxnID($contributionID) {
     $ids = self::getRefundTransactionIDs($contributionID);
-    return isset($ids['trxn_id']) ? $ids['trxn_id'] : NULL;
+    return $ids['trxn_id'] ?? NULL;
   }
 
   /**
@@ -392,7 +392,7 @@ WHERE ceft.entity_id = %1";
     if (!$amount) {
       return FALSE;
     }
-    $contributionId = isset($params['contribution']->id) ? $params['contribution']->id : $params['contribution_id'];
+    $contributionId = $params['contribution']->id ?? $params['contribution_id'];
     if (empty($params['financial_type_id'])) {
       $financialTypeId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionId, 'financial_type_id', 'id');
     }
index b82a0c5dbb34cfe2e844bb9cd2d3217e139b5571..87976ca05c2046aae3e0b7ea9e920c3c607d2948 100644 (file)
@@ -870,17 +870,17 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
    * @return array
    */
   protected static function loadSavedMapping($mappingLocation, int $x, int $i, $mappingName, $mapperFields, $mappingContactType, $mappingRelation, array $specialFields, $mappingPhoneType, array $defaults, array $noneArray, $mappingImProvider, $mappingOperator, $mappingValue) {
-    $locationId = isset($mappingLocation[$x][$i]) ? $mappingLocation[$x][$i] : 0;
+    $locationId = $mappingLocation[$x][$i] ?? 0;
     if (isset($mappingName[$x][$i])) {
       if (is_array($mapperFields[$mappingContactType[$x][$i]])) {
 
         if (isset($mappingRelation[$x][$i])) {
-          $relLocationId = isset($mappingLocation[$x][$i]) ? $mappingLocation[$x][$i] : 0;
+          $relLocationId = $mappingLocation[$x][$i] ?? 0;
           if (!$relLocationId && in_array($mappingName[$x][$i], $specialFields)) {
             $relLocationId = " ";
           }
 
-          $relPhoneType = isset($mappingPhoneType[$x][$i]) ? $mappingPhoneType[$x][$i] : NULL;
+          $relPhoneType = $mappingPhoneType[$x][$i] ?? NULL;
 
           $defaults["mapper[$x][$i]"] = [
             $mappingContactType[$x][$i],
@@ -910,8 +910,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
           $noneArray[] = [$x, $i, 2];
         }
         else {
-          $phoneType = isset($mappingPhoneType[$x][$i]) ? $mappingPhoneType[$x][$i] : NULL;
-          $imProvider = isset($mappingImProvider[$x][$i]) ? $mappingImProvider[$x][$i] : NULL;
+          $phoneType = $mappingPhoneType[$x][$i] ?? NULL;
+          $imProvider = $mappingImProvider[$x][$i] ?? NULL;
           if (!$locationId && in_array($mappingName[$x][$i], $specialFields)) {
             $locationId = " ";
           }
index 4fad6876a8915e4851f49b179137ee4831dd7738..87c8b7c839d8773eef8f818cf66b5331644988b1 100644 (file)
@@ -464,7 +464,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
     if (isset($field->phone_type_id)) {
       $name .= "-{$field->phone_type_id}";
     }
-    $fieldMetaData = CRM_Utils_Array::value($name, $importableFields, (isset($importableFields[$field->field_name]) ? $importableFields[$field->field_name] : []));
+    $fieldMetaData = CRM_Utils_Array::value($name, $importableFields, ($importableFields[$field->field_name] ?? []));
 
     // No lie: this is bizarre; why do we need to mix so many UFGroup properties into UFFields?
     // I guess to make field self sufficient with all the required data and avoid additional calls
@@ -485,12 +485,12 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
       'visibility' => $field->visibility,
       'in_selector' => $field->in_selector,
       'rule' => CRM_Utils_Array::value('rule', CRM_Utils_Array::value($field->field_name, $importableFields)),
-      'location_type_id' => isset($field->location_type_id) ? $field->location_type_id : NULL,
-      'website_type_id' => isset($field->website_type_id) ? $field->website_type_id : NULL,
-      'phone_type_id' => isset($field->phone_type_id) ? $field->phone_type_id : NULL,
+      'location_type_id' => $field->location_type_id ?? NULL,
+      'website_type_id' => $field->website_type_id ?? NULL,
+      'phone_type_id' => $field->phone_type_id ?? NULL,
       'group_id' => $group->id,
-      'add_to_group_id' => isset($group->add_to_group_id) ? $group->add_to_group_id : NULL,
-      'add_captcha' => isset($group->add_captcha) ? $group->add_captcha : NULL,
+      'add_to_group_id' => $group->add_to_group_id ?? NULL,
+      'add_captcha' => $group->add_captcha ?? NULL,
       'field_type' => $field->field_type,
       'field_id' => $field->id,
       'pseudoconstant' => CRM_Utils_Array::value(
index f624810dda164114def4f2f4b042b9d2dff32f5b..3211dd5bb928a80e1dc239e18623fda5af8d0280 100644 (file)
@@ -175,7 +175,7 @@ class CRM_Core_Block {
     if (!(self::$_properties)) {
       self::initProperties();
     }
-    return isset(self::$_properties[$id][$property]) ? self::$_properties[$id][$property] : NULL;
+    return self::$_properties[$id][$property] ?? NULL;
   }
 
   /**
@@ -439,7 +439,7 @@ class CRM_Core_Block {
       $value['url'] = CRM_Utils_System::url($short['path'], $short['query'], FALSE);
     }
     $value['title'] = $short['title'];
-    $value['ref'] = isset($short['ref']) ? $short['ref'] : '';
+    $value['ref'] = $short['ref'] ?? '';
     if (!empty($short['shortCuts'])) {
       foreach ($short['shortCuts'] as $shortCut) {
         $value['shortCuts'][] = self::setShortcutValues($shortCut);
index 84f27ed990f471fd1847a6b98e8b2ec9d35e41ca..88110b643209d61da95f64316165909ba28c7c92 100644 (file)
@@ -224,7 +224,7 @@ class CRM_Core_Config_MagicMerge {
     }
 
     $type = $this->map[$k][0];
-    $name = isset($this->map[$k][1]) ? $this->map[$k][1] : $k;
+    $name = $this->map[$k][1] ?? $k;
 
     switch ($type) {
       case 'setting':
@@ -358,7 +358,7 @@ class CRM_Core_Config_MagicMerge {
     }
     unset($this->cache[$k]);
     $type = $this->map[$k][0];
-    $name = isset($this->map[$k][1]) ? $this->map[$k][1] : $k;
+    $name = $this->map[$k][1] ?? $k;
 
     switch ($type) {
       case 'setting':
index 41e71b0e4891d0ea98f4630b4c57637201128258..01d9bf73ba63bf8482fdf45fc31c28d6ed430c51 100644 (file)
@@ -45,8 +45,8 @@ class CRM_Core_DAO_AllCoreTables {
         $entityType['name'],
         $entityType['class'],
         $entityType['table'],
-        isset($entityType['fields_callback']) ? $entityType['fields_callback'] : NULL,
-        isset($entityType['links_callback']) ? $entityType['links_callback'] : NULL
+        $entityType['fields_callback'] ?? NULL,
+        $entityType['links_callback'] ?? NULL
       );
     }
 
index 56c4938811405dd9b410570da863cb1bd5850ccc..45fe4f8c0924d76c2e62b43ce2fa570b36a34642 100644 (file)
@@ -44,5 +44,5 @@ function _civicrm_api3_permissions($entity, $action, &$params) {
   // Translate specific actions into their generic equivalents
   $action = CRM_Core_Permission::getGenericAction($action);
 
-  return isset($perm[$action]) ? $perm[$action] : $perm['default'];
+  return $perm[$action] ?? $perm['default'];
 }
index 1f0b4d40dbf2e9a81b90e1e90922469605989ca5..c59c63e80cf4a74b6aa76afd03ac7230410f0f0b 100644 (file)
@@ -570,7 +570,7 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     if (!empty(\Civi::$statics[__CLASS__]['userFrameworkLogging'])) {
       // should call $config->userSystem->logger($message) here - but I got a situation where userSystem was not an object - not sure why
       if ($config->userSystem->is_drupal and function_exists('watchdog')) {
-        watchdog('civicrm', '%message', ['%message' => $message], isset($priority) ? $priority : WATCHDOG_DEBUG);
+        watchdog('civicrm', '%message', ['%message' => $message], $priority ?? WATCHDOG_DEBUG);
       }
     }
 
@@ -1005,8 +1005,8 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    */
   public static function deprecatedFunctionWarning($newMethod) {
     $dbt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
-    $callerFunction = isset($dbt[1]['function']) ? $dbt[1]['function'] : NULL;
-    $callerClass = isset($dbt[1]['class']) ? $dbt[1]['class'] : NULL;
+    $callerFunction = $dbt[1]['function'] ?? NULL;
+    $callerClass = $dbt[1]['class'] ?? NULL;
     Civi::log()->warning("Deprecated function $callerClass::$callerFunction, use $newMethod.", ['civi.tag' => 'deprecated']);
   }
 
index 97d9649639f0abb2de9ecbe3744fe7c80419e27f..ec89c3fcfd6f0669a3f24c4a420df0c5b86e6c76 100644 (file)
@@ -487,7 +487,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       $this->ajaxResponse['buttonName'] = str_replace('_qf_' . $this->getAttribute('id') . '_', '', $this->controller->getButtonName());
       $this->ajaxResponse['action'] = $this->_action;
       if (isset($this->_id) || isset($this->id)) {
-        $this->ajaxResponse['id'] = isset($this->id) ? $this->id : $this->_id;
+        $this->ajaxResponse['id'] = $this->id ?? $this->_id;
       }
       CRM_Core_Page_AJAX::returnJsonResponse($this->ajaxResponse);
     }
@@ -1442,7 +1442,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     // Handle custom field
     if (strpos($name, 'custom_') === 0 && is_numeric($name[7])) {
       list(, $id) = explode('_', $name);
-      $label = isset($props['label']) ? $props['label'] : CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', 'label', $id);
+      $label = $props['label'] ?? CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', 'label', $id);
       $gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', 'option_group_id', $id);
       if (CRM_Utils_Array::value('context', $props) != 'search') {
         $props['data-option-edit-path'] = array_key_exists('option_url', $props) ? $props['option_url'] : 'civicrm/admin/options/' . CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $gid);
@@ -1460,7 +1460,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
           break;
         }
       }
-      $label = isset($props['label']) ? $props['label'] : $fieldSpec['title'];
+      $label = $props['label'] ?? $fieldSpec['title'];
       if (CRM_Utils_Array::value('context', $props) != 'search') {
         $props['data-option-edit-path'] = array_key_exists('option_url', $props) ? $props['option_url'] : CRM_Core_PseudoConstant::getOptionEditUrl($fieldSpec);
       }
@@ -1525,10 +1525,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     // Core field - get metadata.
     $fieldSpec = civicrm_api3($props['entity'], 'getfield', $props);
     $fieldSpec = $fieldSpec['values'];
-    $fieldSpecLabel = isset($fieldSpec['html']['label']) ? $fieldSpec['html']['label'] : CRM_Utils_Array::value('title', $fieldSpec);
+    $fieldSpecLabel = $fieldSpec['html']['label'] ?? CRM_Utils_Array::value('title', $fieldSpec);
     $label = CRM_Utils_Array::value('label', $props, $fieldSpecLabel);
 
-    $widget = isset($props['type']) ? $props['type'] : $fieldSpec['html']['type'];
+    $widget = $props['type'] ?? $fieldSpec['html']['type'];
     if ($widget == 'TextArea' && $context == 'search') {
       $widget = 'Text';
     }
@@ -1547,7 +1547,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
         $options = $props['options'];
       }
       else {
-        $options = isset($fieldSpec['options']) ? $fieldSpec['options'] : NULL;
+        $options = $fieldSpec['options'] ?? NULL;
       }
       if ($context == 'search') {
         $widget = $widget == 'Select2' ? $widget : 'Select';
@@ -1579,7 +1579,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       case 'Number':
       case 'Email':
         //TODO: Autodetect ranges
-        $props['size'] = isset($props['size']) ? $props['size'] : 60;
+        $props['size'] = $props['size'] ?? 60;
         return $this->add(strtolower($widget), $name, $label, $props, $required);
 
       case 'hidden':
@@ -1587,8 +1587,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
 
       case 'TextArea':
         //Set default columns and rows for textarea.
-        $props['rows'] = isset($props['rows']) ? $props['rows'] : 4;
-        $props['cols'] = isset($props['cols']) ? $props['cols'] : 60;
+        $props['rows'] = $props['rows'] ?? 4;
+        $props['cols'] = $props['cols'] ?? 60;
         if (empty($props['maxlength']) && isset($fieldSpec['length'])) {
           $props['maxlength'] = $fieldSpec['length'];
         }
@@ -1610,7 +1610,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
         }
 
       case 'Radio':
-        $separator = isset($props['separator']) ? $props['separator'] : NULL;
+        $separator = $props['separator'] ?? NULL;
         unset($props['separator']);
         if (!isset($props['allowClear'])) {
           $props['allowClear'] = !$required;
@@ -1645,13 +1645,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
           $this->addYesNo($name, $label, TRUE, FALSE, $props);
           return;
         }
-        $text = isset($props['text']) ? $props['text'] : NULL;
+        $text = $props['text'] ?? NULL;
         unset($props['text']);
         return $this->addElement('checkbox', $name, $label, $text, $props);
 
       //add support for 'Advcheckbox' field
       case 'advcheckbox':
-        $text = isset($props['text']) ? $props['text'] : NULL;
+        $text = $props['text'] ?? NULL;
         unset($props['text']);
         return $this->addElement('advcheckbox', $name, $label, $text, $props);
 
@@ -1671,7 +1671,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
         return $this->addEntityRef($name, $label, $props, $required);
 
       case 'Password':
-        $props['size'] = isset($props['size']) ? $props['size'] : 60;
+        $props['size'] = $props['size'] ?? 60;
         return $this->add('password', $name, $label, $props, $required);
 
       // Check datatypes of fields
@@ -1771,7 +1771,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    * @return null
    */
   public function getVar($name) {
-    return isset($this->$name) ? $this->$name : NULL;
+    return $this->$name ?? NULL;
   }
 
   /**
index 1ea5fa8b162011856cc5949ededa65540003921c..3935d8043388b41602d535a4d15eb91209bc5821 100644 (file)
@@ -238,7 +238,7 @@ class CRM_Core_Invoke {
         $result = $wrapper->run(
           CRM_Utils_Array::value('page_callback', $item),
           CRM_Utils_Array::value('title', $item),
-          isset($pageArgs) ? $pageArgs : NULL
+          $pageArgs ?? NULL
         );
       }
       else {
index 1f6dd6e01a914d854890ff1ae9f569274aaefa7e..251c642d7530cc706eb34c69af356fc92cdc4e3e 100644 (file)
@@ -383,7 +383,7 @@ class CRM_Core_Page {
    * @return null
    */
   public function getVar($name) {
-    return isset($this->$name) ? $this->$name : NULL;
+    return $this->$name ?? NULL;
   }
 
   /**
index a36d8975ee64aae91dcf3dedf4e759b71207a416..0ad98467e8b5d5b3f510c257375399ffcfa3b2b9 100644 (file)
@@ -124,7 +124,7 @@ class CRM_Core_Page_File extends CRM_Core_Page {
       'image/pjpeg' => 'image/jpeg',
 
     ];
-    return isset($badTypes[$type]) ? $badTypes[$type] : $type;
+    return $badTypes[$type] ?? $type;
   }
 
 }
index b1df8ec53a13cdb6aa7b42d91d8eac61b4b3ed00..40718337d69b32c2448659ee8bb4c40dd50a7b75 100644 (file)
@@ -605,7 +605,7 @@ abstract class CRM_Core_Payment {
    * @return null
    */
   public function getVar($name) {
-    return isset($this->$name) ? $this->$name : NULL;
+    return $this->$name ?? NULL;
   }
 
   /**
@@ -1689,7 +1689,7 @@ INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id )
     }
 
     // Else default
-    return isset($this->_paymentProcessor['url_recur']) ? $this->_paymentProcessor['url_recur'] : '';
+    return $this->_paymentProcessor['url_recur'] ?? '';
   }
 
   /**
index 496f46d22ee12da1afb430f5a3fa26ba1b135e8e..1c7263812c522bae496812da1b71964e17012560 100644 (file)
@@ -100,7 +100,7 @@ class CRM_Core_Payment_Form {
   protected static function addCommonFields(&$form, $paymentFields) {
     $requiredPaymentFields = $paymentFieldsMetadata = [];
     foreach ($paymentFields as $name => $field) {
-      $field['extra'] = isset($field['extra']) ? $field['extra'] : NULL;
+      $field['extra'] = $field['extra'] ?? NULL;
       if ($field['htmlType'] == 'chainSelect') {
         $form->addChainSelect($field['name'], ['required' => FALSE]);
       }
index cb71dbd438d304f92465b147ec632bda2459cf9e..d23d88e9ec740f6e90636b37bb1e561d701269ed 100644 (file)
@@ -1103,7 +1103,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
   protected function mapPaypalParamsToCivicrmParams($fieldMap, $paypalParams) {
     $params = [];
     foreach ($fieldMap as $civicrmField => $paypalField) {
-      $params[$civicrmField] = isset($paypalParams[$paypalField]) ? $paypalParams[$paypalField] : NULL;
+      $params[$civicrmField] = $paypalParams[$paypalField] ?? NULL;
     }
     return $params;
   }
index 5a4931d214b44f4d6a306db820f3099f11391b50..8100aa95319546b764e21f63e5318ed6d543ccc5 100644 (file)
@@ -276,7 +276,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
       if ($data['level'] == $depth) {
         switch ($data['type']) {
           case 'complete':
-            $output[$data['tag']] = isset($data['value']) ? $data['value'] : '';
+            $output[$data['tag']] = $data['value'] ?? '';
             break;
 
           case 'open':
@@ -364,7 +364,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     $this->_setParam('country', $params['country']);
     $this->_setParam('post_code', $params['postal_code']);
     $this->_setParam('order_id', $params['invoiceID']);
-    $params['issue_number'] = (isset($params['issue_number']) ? $params['issue_number'] : '');
+    $params['issue_number'] = ($params['issue_number'] ?? '');
     $this->_setParam('issue_number', $params['issue_number']);
     $this->_setParam('varref', $params['contributionType_name']);
     $comment = $params['description'] . ' (page id:' . $params['contributionPageID'] . ')';
index 481a8b157575b09d343e3cf26c1867ae71548be0..5811de058183e9dbc68f80d0ce521b9264846886 100644 (file)
@@ -41,7 +41,7 @@ class CRM_Core_PrevNextCache_Redis implements CRM_Core_PrevNextCache_Interface {
    */
   public function __construct($settings) {
     $this->redis = CRM_Utils_Cache_Redis::connect($settings);
-    $this->prefix = isset($settings['prefix']) ? $settings['prefix'] : '';
+    $this->prefix = $settings['prefix'] ?? '';
     $this->prefix .= \CRM_Utils_Cache::DELIMITER . 'prevnext' . \CRM_Utils_Cache::DELIMITER;
   }
 
index 4fc96a074e89ee35fd91f27fb6466a84d72891da..b1809af63629f209e129148ec10e6e2f5659782d 100644 (file)
@@ -191,7 +191,7 @@ class CRM_Core_Region {
           break;
 
         case 'callback':
-          $args = isset($snippet['arguments']) ? $snippet['arguments'] : array(&$snippet, &$html);
+          $args = $snippet['arguments'] ?? array(&$snippet, &$html);
           $html .= call_user_func_array($snippet['callback'], $args);
           break;
 
index ef0fc4dab07e77a69801ce21744598b9f55726c7..e45873d4dbbf55e53919283b75428c7e1e78ee72 100644 (file)
@@ -276,7 +276,7 @@ class CRM_Core_Smarty extends Smarty {
     $oldVars = $this->get_template_vars();
     $backupFrame = [];
     foreach ($vars as $key => $value) {
-      $backupFrame[$key] = isset($oldVars[$key]) ? $oldVars[$key] : NULL;
+      $backupFrame[$key] = $oldVars[$key] ?? NULL;
     }
     $this->backupFrames[] = $backupFrame;
 
index d6557b19e6c498970eddb1f0653d6072886a4b73..eabc3384a4275a5f3c12c687dbd50beb1994b959 100644 (file)
@@ -27,6 +27,6 @@
  * @return string
  */
 function smarty_function_crmAttributes($params, &$smarty) {
-  $attributes = isset($params['a']) ? $params['a'] : [];
+  $attributes = $params['a'] ?? [];
   return CRM_Utils_String::htmlAttributes($attributes);
 }
index e502c72e15b1ffb03bfe191184ec4279f9551901..50492eab5cb6d9cdc0879825e65a864d5e891d58 100644 (file)
@@ -140,7 +140,7 @@ class CRM_Custom_Form_CustomData {
     }
 
     $gid = (isset($form->_groupID)) ? $form->_groupID : NULL;
-    $getCachedTree = isset($form->_getCachedTree) ? $form->_getCachedTree : TRUE;
+    $getCachedTree = $form->_getCachedTree ?? TRUE;
 
     $subType = $form->_subType;
     if (!is_array($subType) && strstr($subType, CRM_Core_DAO::VALUE_SEPARATOR)) {
index e0bb74ac159c8dcdbf15a38ae42824368e99b48b..87d73ad5b32150110a69ef5cf1fc6461a1bb8208 100644 (file)
@@ -296,7 +296,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page {
               }
             }
             else {
-              $colValue = $colValue ? ($colValue . (isset($subTypes[$type][$sub]) ? ', ' . $subTypes[$type][$sub] : '')) : (isset($subTypes[$type][$sub]) ? $subTypes[$type][$sub] : '');
+              $colValue = $colValue ? ($colValue . (isset($subTypes[$type][$sub]) ? ', ' . $subTypes[$type][$sub] : '')) : ($subTypes[$type][$sub] ?? '');
             }
           }
         }
index ff9b315d553855dc46cc0125585e8a7b01a6af44..9ae0b4e279f64f0931cbf72c58f83296e900db8e 100644 (file)
@@ -1554,7 +1554,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
           //add dataArray in the receipts in ADD and UPDATE condition
           $dataArray = [];
           if ($this->_action & CRM_Core_Action::ADD) {
-            $line = isset($lineItem[0]) ? $lineItem[0] : [];
+            $line = $lineItem[0] ?? [];
           }
           elseif ($this->_action & CRM_Core_Action::UPDATE) {
             $line = $this->_values['line_items'];
index acbc6afed2f631bac0d3dd6f71bc650162f5624d..9a8ed169feb7756c791a841e482c85f8db60a886 100644 (file)
@@ -519,7 +519,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
     //if payment done, no need to build the fee block.
     if (!empty($form->_paymentId)) {
       //fix to display line item in update mode.
-      $form->assign('priceSet', isset($form->_priceSet) ? $form->_priceSet : NULL);
+      $form->assign('priceSet', $form->_priceSet ?? NULL);
       return;
     }
 
@@ -686,7 +686,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
 
     $skipParticipants = $formattedPriceSetDefaults = [];
     if (!empty($form->_allowConfirmation) && (isset($form->_pId) || isset($form->_additionalParticipantId))) {
-      $participantId = isset($form->_pId) ? $form->_pId : $form->_additionalParticipantId;
+      $participantId = $form->_pId ?? $form->_additionalParticipantId;
       $pricesetDefaults = CRM_Event_Form_EventFees::setDefaultPriceSet($participantId,
         $form->_eventId
       );
index d1d0c9cdf81d3b74e25499699531b3df0bdae421..8cb0c341218d031218ba5870779f6b31dbd7f668 100644 (file)
@@ -189,7 +189,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
       $this->assign('participantCount', $participantCount);
       $this->assign('lineItems', $lineItems);
 
-      $taskParams['ssID'] = isset($this->_ssID) ? $this->_ssID : NULL;
+      $taskParams['ssID'] = $this->_ssID ?? NULL;
       $tasks = CRM_Event_Task::permissionedTaskTitles(CRM_Core_Permission::getPermission(), $taskParams);
 
       if (isset($this->_ssID)) {
index a97d041888db86a67b1cad8947366a8a6a840b8c..106c02f35c1944e653caa11ebd9bb40c0efe5926 100644 (file)
@@ -518,7 +518,7 @@ class CRM_Export_BAO_ExportProcessor {
    * @return string
    */
   public function getRelationshipValue($relationshipType, $contactID, $field) {
-    return isset($this->relatedContactValues[$relationshipType][$contactID][$field]) ? $this->relatedContactValues[$relationshipType][$contactID][$field] : '';
+    return $this->relatedContactValues[$relationshipType][$contactID][$field] ?? '';
   }
 
   /**
index b577a7fca64a31729c6e86659417746b8750e1ef..be246e53e884342e77cf0de1caa57ce928f4d463 100644 (file)
@@ -532,7 +532,7 @@ INNER JOIN civicrm_contribution       con ON ( mp.contribution_id = con.id )
 
     }
 
-    $ppID = (isset($dao->ppID1) && $dao->ppID1) ? $dao->ppID1 : (isset($dao->ppID2) ? $dao->ppID2 : NULL);
+    $ppID = (isset($dao->ppID1) && $dao->ppID1) ? $dao->ppID1 : ($dao->ppID2 ?? NULL);
     $mode = (isset($dao->is_test) && $dao->is_test) ? 'test' : 'live';
     if (!$ppID || $type == 'id') {
       $result = $ppID;
index fe4c54280ed52c5b05bff18f2992b5e5df47f7c6..f013f97945ceeffffc33af0b3cf21307408c5c51 100644 (file)
@@ -134,7 +134,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
         $groupValues = array(
           'id' => $this->_id,
           'title' => $this->_title,
-          'saved_search_id' => isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
+          'saved_search_id' => $this->_groupValues['saved_search_id'] ?? '',
         );
         if (isset($this->_groupValues['saved_search_id'])) {
           $groupValues['mapping_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch',
index 8eba240474dc70b7b14adbe803f6114a13025b22..bfe559191dc5e985a41d1a7178ee36e468284317 100644 (file)
@@ -335,7 +335,7 @@ abstract class CRM_Import_Parser {
       file_put_contents($statusFile, $contents);
     }
     else {
-      $rowCount = isset($this->_rowCount) ? $this->_rowCount : $this->_lineCount;
+      $rowCount = $this->_rowCount ?? $this->_lineCount;
       $currTimestamp = time();
       $totalTime = ($currTimestamp - $startTimestamp);
       $time = ($currTimestamp - $prevTimestamp);
index 57fca1a971a32377e96fc19cae34ac1ed47e214d..bae5e9902ea360a086a764367715146150258a98 100644 (file)
@@ -1523,7 +1523,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
   public static function create(&$params, $ids = []) {
 
     if (empty($params['id']) && (array_filter($ids) !== [])) {
-      $params['id'] = isset($ids['mailing_id']) ? $ids['mailing_id'] : $ids['id'];
+      $params['id'] = $ids['mailing_id'] ?? $ids['id'];
       \Civi::log('Parameter $ids is no longer used by Mailing::create. Use the api or just pass $params', ['civi.tag' => 'deprecated']);
     }
 
index 7b858c33a726eb34c3ef999542f18c0f855b46b3..363c8efc89a550a55335f4dc47b87a354679fc84 100644 (file)
@@ -141,7 +141,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page {
       return NULL;
     }
 
-    $contactId = isset($this->_contactID) ? $this->_contactID : 0;
+    $contactId = $this->_contactID ?? 0;
 
     $result = civicrm_api3('Mailing', 'preview', [
       'id' => $this->_mailingID,
index ce16334c3a96a48b51ffec394c81102424792dab..4de273f0c488903e806d35c0bca07945472527f9 100644 (file)
@@ -2636,9 +2636,9 @@ WHERE      civicrm_membership.is_test = 0
            * Update status
            */
           $status = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate(
-            isset($updates["start_date"]) ? $updates["start_date"] : $newMembership->start_date,
-            isset($updates["end_date"]) ? $updates["end_date"] : $newMembership->end_date,
-            isset($updates["join_date"]) ? $updates["join_date"] : $newMembership->join_date,
+            $updates["start_date"] ?? $newMembership->start_date,
+            $updates["end_date"] ?? $newMembership->end_date,
+            $updates["join_date"] ?? $newMembership->join_date,
             'today',
             FALSE,
             $newMembershipId,
index 799399247fd091b55336bb3a20a5254066d9bd3e..22eb984b8b6634339e72a4d0880b8e5003cfe0d1 100644 (file)
@@ -76,8 +76,8 @@ class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task {
   public function postProcess() {
     // TODO: rewrite using contribution token and one letter by contribution
     $this->setContactIDs();
-    $skipOnHold = isset($this->skipOnHold) ? $this->skipOnHold : FALSE;
-    $skipDeceased = isset($this->skipDeceased) ? $this->skipDeceased : TRUE;
+    $skipOnHold = $this->skipOnHold ?? FALSE;
+    $skipDeceased = $this->skipDeceased ?? TRUE;
     CRM_Member_Form_Task_PDFLetterCommon::postProcessMembers(
       $this, $this->_memberIds, $skipOnHold, $skipDeceased, $this->_contactIds
     );
index a991c85bcfefd0e15ccc60d49f443c3b2daf5b44..30b4f4626eed22c1d5447ddf8bf8c6055c9597dd 100644 (file)
@@ -45,7 +45,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
     $this->assign('dataValues', $this->_dataValues);
 
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
-    $this->_onDuplicate = $this->get('onDuplicate', isset($onDuplicate) ? $onDuplicate : "");
+    $this->_onDuplicate = $this->get('onDuplicate', $onDuplicate ?? "");
 
     $highlightedFields = array();
     if ($skipColumnHeader) {
@@ -455,9 +455,9 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
         $updateMappingFields->column_number = $i;
 
         $mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
-        $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
-        $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
-        $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+        $id = $mapperKeyParts[0] ?? NULL;
+        $first = $mapperKeyParts[1] ?? NULL;
+        $second = $mapperKeyParts[2] ?? NULL;
         $updateMappingFields->name = $mapper[$i];
         $updateMappingFields->save();
       }
@@ -479,9 +479,9 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
         $saveMappingFields->column_number = $i;
 
         $mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
-        $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
-        $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
-        $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+        $id = $mapperKeyParts[0] ?? NULL;
+        $first = $mapperKeyParts[1] ?? NULL;
+        $second = $mapperKeyParts[2] ?? NULL;
         $saveMappingFields->name = $mapper[$i];
         $saveMappingFields->save();
       }
index ab87781e6036deca2c35f82e77550a0292337e16..95af552f52bc1d775c070f550f20394f3285964b 100644 (file)
@@ -888,7 +888,7 @@ WHERE pcp.id = %1";
       'contribute' => 'civicrm_contribution_page',
       'civicrm_contribution_page' => 'civicrm_contribution_page',
     ];
-    return isset($entity_table_map[$component]) ? $entity_table_map[$component] : FALSE;
+    return $entity_table_map[$component] ?? FALSE;
   }
 
   /**
index 44d7d872f8cefe143a30a597d6fb218726f0d0a1..78e6df6d00d31d68849b18fe2c866043b9690355 100644 (file)
@@ -187,7 +187,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
       }
     }
     $session = CRM_Core_Session::singleton();
-    $contactID = isset($this->_contactID) ? $this->_contactID : $session->get('userID');
+    $contactID = $this->_contactID ?? $session->get('userID');
     if (!$contactID) {
       $contactID = $this->get('contactID');
     }
index 2246b187c210562e39cc3858845cb1c725798589..d240da76aa745e1d2ed8b48a1fe912266354a139 100644 (file)
@@ -53,7 +53,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
       $contactID = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $this->_id, 'contact_id');
     }
 
-    $this->_contactID = isset($contactID) ? $contactID : $session->get('userID');
+    $this->_contactID = $contactID ?? $session->get('userID');
     if (!$this->_pageId) {
       if (!$this->_id) {
         $msg = ts('We can\'t load the requested web page due to an incomplete link. This can be caused by using your browser\'s Back button or by using an incomplete or invalid link.');
index f8f7f01b9b48bdb33f7520dd28debd85b346d796..4577c67f1286cfae50891995d70e9ac7f52e25bd 100644 (file)
@@ -841,7 +841,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
         $addCaptcha[$field['group_id']] = $field['add_captcha'];
       }
 
-      if (($name == 'email-Primary') || ($name == 'email-' . isset($primaryLocationType) ? $primaryLocationType : "")) {
+      if (($name == 'email-Primary') || ($name == 'email-' . $primaryLocationType ?? "")) {
         $emailPresent = TRUE;
         $this->_mail = $name;
       }
index d44a073b5232126b175229ea585596c013a3c0b2..be45d00fe3024791ff0c973dbfaacf1715c97c29 100644 (file)
@@ -315,7 +315,7 @@ class CRM_Queue_Runner {
     $result = [];
     $result['is_error'] = $isOK ? 0 : 1;
     $result['exception'] = $exception;
-    $result['last_task_title'] = isset($this->lastTaskTitle) ? $this->lastTaskTitle : '';
+    $result['last_task_title'] = $this->lastTaskTitle ?? '';
     $result['numberOfItems'] = $this->queue->numberOfItems();
     if ($result['numberOfItems'] <= 0) {
       // nothing to do
index 2c7f1034288d0738f002d63d36921fbb3bf502c4..6935b9b5277ae4c9c92168a3bd06e01a5c6a0389 100644 (file)
@@ -50,7 +50,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
       $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
       $params['domain_id'] = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
       // CRM-17256 set created_id on report creation.
-      $params['created_id'] = isset($params['created_id']) ? $params['created_id'] : CRM_Core_Session::getLoggedInContactID();
+      $params['created_id'] = $params['created_id'] ?? CRM_Core_Session::getLoggedInContactID();
     }
 
     if ($instanceID) {
index cf099a3debbe6a3adb9096e564e951312fa76019..b1f8ac81820c1c9919388ebd927cd5c48219a8e1 100644 (file)
@@ -756,7 +756,7 @@ class CRM_Report_Form extends CRM_Core_Form {
         if (!empty($table[$fieldGrp]) && is_array($table[$fieldGrp])) {
           foreach ($table[$fieldGrp] as $fieldName => $field) {
             // $name is the field name used to reference the BAO/DAO export fields array
-            $name = isset($field['name']) ? $field['name'] : $fieldName;
+            $name = $field['name'] ?? $fieldName;
 
             // Sometimes the field name key in the BAO/DAO export fields array is
             // different from the actual database field name.
@@ -790,8 +790,8 @@ class CRM_Report_Form extends CRM_Core_Form {
             }
 
             // set alias = table-name, unless already set
-            $alias = isset($field['alias']) ? $field['alias'] : (
-              isset($this->_columns[$tableName]['alias']) ? $this->_columns[$tableName]['alias'] : $tableName
+            $alias = $field['alias'] ?? (
+              $this->_columns[$tableName]['alias'] ?? $tableName
             );
             $this->_columns[$tableName][$fieldGrp][$fieldName]['alias'] = $alias;
 
index 5e3d04bca8395ef17ca2b972fc445c62a3967edb..8918930610a8aeff3870d29602b49052cd669881 100644 (file)
@@ -340,13 +340,13 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form {
       if (isset($row['civicrm_activity_activity_type_id'])) {
         $entryFound = TRUE;
         $val = $row['civicrm_activity_activity_type_id'];
-        $rows[$rowNum]['civicrm_activity_activity_type_id'] = isset($this->activityTypes[$val]) ? $this->activityTypes[$val] : '';
+        $rows[$rowNum]['civicrm_activity_activity_type_id'] = $this->activityTypes[$val] ?? '';
       }
 
       if (isset($row['civicrm_activity_status_id'])) {
         $entryFound = TRUE;
         $val = $row['civicrm_activity_status_id'];
-        $rows[$rowNum]['civicrm_activity_status_id'] = isset($this->activityStatuses[$val]) ? $this->activityStatuses[$val] : '';
+        $rows[$rowNum]['civicrm_activity_status_id'] = $this->activityStatuses[$val] ?? '';
       }
 
       // The next two make it easier to make pivot tables after exporting to Excel
index 90f7528c4973f441beebfcd38ef5ce44936315d7..4afb250c40fa9608798c11d470169cf9fe71f4b1 100644 (file)
@@ -271,7 +271,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
       foreach ($ufJoinRecords as $key => $value) {
         $checked[$value] = 1;
       }
-      $defaults['uf_group_type'] = isset($checked) ? $checked : "";
+      $defaults['uf_group_type'] = $checked ?? "";
 
       $showAdvanced = 0;
       $advFields = [
index 30724c0508a7b17bdc644f3426a9a5c65748e681..28267eebaccb79652479984fe62e2979013a4e20 100644 (file)
@@ -621,7 +621,7 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
     foreach ($backend as $propertyName => $propertyValue) {
       if (isset($mappings[$propertyName][0]) && preg_match('/^setting/', $mappings[$propertyName][0])) {
         // $mapping format: $propertyName => Array(0 => $type, 1 => $setting|NULL).
-        $settingName = isset($mappings[$propertyName][1]) ? $mappings[$propertyName][1] : $propertyName;
+        $settingName = $mappings[$propertyName][1] ?? $propertyName;
         $settings[$settingName] = $propertyValue;
       }
     }
index 1a3d8a002072b1cab93d60e1a9bf724d69bb6718..c6eaec21998762cf690f66129d4d9568623d5172 100644 (file)
@@ -569,10 +569,10 @@ class CRM_Utils_Array {
       $node = &$result;
       foreach ($keys as $key) {
         if (is_array($record)) {
-          $keyvalue = isset($record[$key]) ? $record[$key] : NULL;
+          $keyvalue = $record[$key] ?? NULL;
         }
         else {
-          $keyvalue = isset($record->{$key}) ? $record->{$key} : NULL;
+          $keyvalue = $record->{$key} ?? NULL;
         }
         if (isset($node[$keyvalue]) && !is_array($node[$keyvalue])) {
           $node[$keyvalue] = [];
index b5cb655e4214474933bcc7f4b901427c675daa6e..b9db031f07708843622994642cb21f86be5c76f8 100644 (file)
@@ -60,8 +60,8 @@ class CRM_Utils_Cache_Redis implements CRM_Utils_Cache_Interface {
    * @return Redis
    */
   public static function connect($config) {
-    $host = isset($config['host']) ? $config['host'] : self::DEFAULT_HOST;
-    $port = isset($config['port']) ? $config['port'] : self::DEFAULT_PORT;
+    $host = $config['host'] ?? self::DEFAULT_HOST;
+    $port = $config['port'] ?? self::DEFAULT_PORT;
     // Ugh.
     $pass = CRM_Utils_Constant::value('CIVICRM_DB_CACHE_PASSWORD');
     $id = implode(':', ['connect', $host, $port /* $pass is constant */]);
index df20858d5b7e83c10da8783e891207cd52091ea8..4031a11ad71d9b3ffa1f1a3661cf4f0f23a03b0b 100644 (file)
@@ -1093,7 +1093,7 @@ class CRM_Utils_Date {
     $from['H'] = $from['i'] = $from['s'] = 0;
     $relativeTermParts = explode('_', $relativeTerm);
     $relativeTermPrefix = $relativeTermParts[0];
-    $relativeTermSuffix = isset($relativeTermParts[1]) ? $relativeTermParts[1] : '';
+    $relativeTermSuffix = $relativeTermParts[1] ?? '';
 
     switch ($unit) {
       case 'year':
index 73469e553f59210f9e6ea8ad390bc2a66f8b1860..76a440e26a2cd2bbc6dc3e7b07701db8e9ee1337 100644 (file)
@@ -386,8 +386,8 @@ class CRM_Utils_Migrate_Export {
    * @param null $sql
    */
   public function fetch($groupName, $daoName, $sql = NULL) {
-    $idNameFields = isset($this->_xml[$groupName]['idNameFields']) ? $this->_xml[$groupName]['idNameFields'] : NULL;
-    $mappedFields = isset($this->_xml[$groupName]['mappedFields']) ? $this->_xml[$groupName]['mappedFields'] : NULL;
+    $idNameFields = $this->_xml[$groupName]['idNameFields'] ?? NULL;
+    $mappedFields = $this->_xml[$groupName]['mappedFields'] ?? NULL;
 
     $dao = new $daoName();
     if ($sql) {
index 472dab1cef7e8d3fd409b38761da13aec332c0cc..6bbc076691c71146d757d848c3d1fdddd0ee7bdc 100644 (file)
@@ -89,7 +89,7 @@ class CRM_Utils_SQL_Delete extends CRM_Utils_SQL_BaseParamQuery {
    */
   public function __construct($from, $options = []) {
     $this->from = $from;
-    $this->mode = isset($options['mode']) ? $options['mode'] : self::INTERPOLATE_AUTO;
+    $this->mode = $options['mode'] ?? self::INTERPOLATE_AUTO;
   }
 
   /**
index 1906dc31924d9eb8b510ae14d24fb8bfb8c905f5..47707a316fd8727a4d31f95eddcd6e064325e8e7 100644 (file)
@@ -111,7 +111,7 @@ class CRM_Utils_SQL_Select extends CRM_Utils_SQL_BaseParamQuery {
    */
   public function __construct($from, $options = []) {
     $this->from = $from;
-    $this->mode = isset($options['mode']) ? $options['mode'] : self::INTERPOLATE_AUTO;
+    $this->mode = $options['mode'] ?? self::INTERPOLATE_AUTO;
   }
 
   /**
index 9b2652a28a92c933c198a9071a0c3e02893be001..4eb580dded8f6bd7ee096a231b8af0657e40b283 100644 (file)
@@ -836,9 +836,9 @@ class CRM_Utils_String {
    */
   public static function simpleParseUrl($url) {
     $parts = parse_url($url);
-    $host = isset($parts['host']) ? $parts['host'] : '';
+    $host = $parts['host'] ?? '';
     $port = isset($parts['port']) ? ':' . $parts['port'] : '';
-    $path = isset($parts['path']) ? $parts['path'] : '';
+    $path = $parts['path'] ?? '';
     $query = isset($parts['query']) ? '?' . $parts['query'] : '';
     return [
       'host+port' => "$host$port",
index 6c215d2954f825fcb02c18f0f3adb580cf9d7a99..15854d778dc140104995f5bffe894e903e3218ac 100644 (file)
@@ -723,7 +723,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   public function getLoggedInUfID() {
     $ufID = NULL;
     $current_user = $this->getLoggedInUserObject();
-    return isset($current_user->ID) ? $current_user->ID : NULL;
+    return $current_user->ID ?? NULL;
   }
 
   /**
index 18fb15511c457767cbc53902298ad16dfb800bce..0b3b9fa4607c11d8d1f643cbdfc4145ccd99d223 100644 (file)
@@ -237,7 +237,7 @@ class CRM_Utils_VersionCheck {
       $this->stats['extensions'][] = [
         'name' => $dao->full_name,
         'enabled' => $dao->is_active,
-        'version' => isset($info->version) ? $info->version : NULL,
+        'version' => $info->version ?? NULL,
       ];
     }
   }
index 514b8469312592e879b06028992195b4cf2d561c..87b95bb18b725924c67b58d751ccc953b5ed6b78 100644 (file)
@@ -134,7 +134,7 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface
    */
   public function getActionNames($version, $entity) {
     $entity = _civicrm_api_get_camel_name($entity, $version);
-    return isset($this->actions[$entity]) ? $this->actions[$entity] : $this->actions['*'];
+    return $this->actions[$entity] ?? $this->actions['*'];
   }
 
 }
index f74479fb4685360be0be01adbb36a036f309f88f..58e69987004adee665fd985cc26657b44038c291 100644 (file)
@@ -73,7 +73,7 @@ class AngularLoader {
     $this->res = \CRM_Core_Resources::singleton();
     $this->angular = \Civi::service('angular');
     $this->region = \CRM_Utils_Request::retrieve('snippet', 'String') ? 'ajax-snippet' : 'html-header';
-    $this->pageName = isset($_GET['q']) ? $_GET['q'] : NULL;
+    $this->pageName = $_GET['q'] ?? NULL;
     $this->modules = [];
   }
 
index ea9d3cdb9d2f2b758667ebe0bda9ae54f6bdbe6c..4b0002ede77128980bd0c6a2411f0b06de5efb59 100644 (file)
@@ -43,7 +43,7 @@ abstract class AbstractCreateAction extends AbstractAction {
    * @return mixed|null
    */
   public function getValue(string $fieldName) {
-    return isset($this->values[$fieldName]) ? $this->values[$fieldName] : NULL;
+    return $this->values[$fieldName] ?? NULL;
   }
 
   /**
index 93940e1976ff717ac011c72a0fbc4c276679800c..aa1aa0d46cb53f7596bb3d73fa54a10bc2b0c20b 100644 (file)
@@ -57,7 +57,7 @@ abstract class AbstractUpdateAction extends AbstractBatchAction {
    * @return mixed|null
    */
   public function getValue(string $fieldName) {
-    return isset($this->values[$fieldName]) ? $this->values[$fieldName] : NULL;
+    return $this->values[$fieldName] ?? NULL;
   }
 
   /**
index 51491e9e8e8be5f99f1a4f6a3bf558aaa113d058..baddfe1a09a3ccf53def68d7c2c578bce0f98dd6 100644 (file)
@@ -108,9 +108,9 @@ trait ArrayQueryActionTrait {
     if (!is_array($condition)) {
       throw new NotImplementedException('Unexpected where syntax; expecting array.');
     }
-    $value = isset($row[$condition[0]]) ? $row[$condition[0]] : NULL;
+    $value = $row[$condition[0]] ?? NULL;
     $operator = $condition[1];
-    $expected = isset($condition[2]) ? $condition[2] : NULL;
+    $expected = $condition[2] ?? NULL;
     switch ($operator) {
       case '=':
       case '!=':
index 8c63e66228ca0a3770abe56bf4544d647107c6ac..1cfc94561964ecb7bceb2ff4a63721dd7662eb98 100644 (file)
@@ -144,7 +144,7 @@ class SpecFormatter {
    * @param string $dataTypeName
    */
   public static function setInputTypeAndAttrs(FieldSpec &$fieldSpec, $data, $dataTypeName) {
-    $inputType = isset($data['html']['type']) ? $data['html']['type'] : ArrayHelper::value('html_type', $data);
+    $inputType = $data['html']['type'] ?? ArrayHelper::value('html_type', $data);
     $inputAttrs = ArrayHelper::value('html', $data, []);
     unset($inputAttrs['type']);
 
index beae7ac77976f9441581a744c8e830d73305a643..925ac77387b4b9d2f49a550942735e70b64a5045 100644 (file)
@@ -71,7 +71,7 @@ class CompareCommand {
     foreach ($tests as $test) {
       $values = [];
       foreach ($suites as $suite) {
-        $values[] = isset($suite['results'][$test]) ? $suite['results'][$test] : 'MISSING';
+        $values[] = $suite['results'][$test] ?? 'MISSING';
       }
 
       if (count(array_unique($values)) > 1) {
index ad260c099c32b6bcfcf9b392de78ab8d050e342b..77d91684e25b2b25426a10e243c8153bd673118b 100644 (file)
@@ -133,7 +133,7 @@ class CiviEventInspector {
    * @return CiviEventInspector
    */
   public function add($eventDef) {
-    $name = isset($eventDef['name']) ? $eventDef['name'] : NULL;
+    $name = $eventDef['name'] ?? NULL;
 
     if (!isset($eventDef['type'])) {
       $eventDef['type'] = preg_match('/^hook_/', $eventDef['name']) ? 'hook' : 'object';
index b1e54684a627629d4004068b9e83330177c76f38..379f94d64c3766f609c800f2a8187d72307b045a 100644 (file)
@@ -197,7 +197,7 @@ class ResolverApi {
     }
 
     $result = civicrm_api3($this->url['host'], ltrim($this->url['path'], '/'), $apiParams);
-    return isset($result['values']) ? $result['values'] : NULL;
+    return $result['values'] ?? NULL;
   }
 
   /**
index 779bc3a2302f0df8b769dca98a59c6baf8e291d1..28f3ef36869eed85562f4c020ddb6b71bc4ffe54 100644 (file)
@@ -179,7 +179,7 @@ class SettingsBag {
    */
   public function get($key) {
     $all = $this->all();
-    return isset($all[$key]) ? $all[$key] : NULL;
+    return $all[$key] ?? NULL;
   }
 
   /**
@@ -190,7 +190,7 @@ class SettingsBag {
    * @return mixed|NULL
    */
   public function getDefault($key) {
-    return isset($this->defaults[$key]) ? $this->defaults[$key] : NULL;
+    return $this->defaults[$key] ?? NULL;
   }
 
   /**
@@ -202,7 +202,7 @@ class SettingsBag {
    * @return mixed|NULL
    */
   public function getExplicit($key) {
-    return (isset($this->values[$key]) ? $this->values[$key] : NULL);
+    return ($this->values[$key] ?? NULL);
   }
 
   /**
@@ -213,7 +213,7 @@ class SettingsBag {
    * @return mixed|NULL
    */
   public function getMandatory($key) {
-    return isset($this->mandatory[$key]) ? $this->mandatory[$key] : NULL;
+    return $this->mandatory[$key] ?? NULL;
   }
 
   /**
index 46d9b7bb35e68c288aff54957cffcb780e69b4bf..4970ff93ad0e587af65a4282f665c0cf40efc767 100644 (file)
@@ -291,7 +291,7 @@ class SettingsManager {
 
     if (is_array($civicrm_setting)) {
       foreach ($civicrm_setting as $oldGroup => $values) {
-        $newGroup = isset($rewriteGroups[$oldGroup]) ? $rewriteGroups[$oldGroup] : 'domain';
+        $newGroup = $rewriteGroups[$oldGroup] ?? 'domain';
         $result[$newGroup] = array_merge($result[$newGroup], $values);
       }
     }
index f7118d69d3d13a6605c521f26cc30dea5958bc04..c3550bc63d30428fc4fbc97fac965e888453a3ba 100644 (file)
@@ -97,7 +97,7 @@ class Themes {
    */
   public function get($themeKey) {
     $all = $this->getAll();
-    return isset($all[$themeKey]) ? $all[$themeKey] : NULL;
+    return $all[$themeKey] ?? NULL;
   }
 
   /**
index bfa8130d393d9408c055d493fb86af898391f1d7..263e39fa01f178f5f7178038bb2257475f7f8430 100644 (file)
@@ -129,7 +129,7 @@ class Manager {
    * @return \Civi\Core\Transaction\Frame
    */
   public function getFrame() {
-    return isset($this->frames[0]) ? $this->frames[0] : NULL;
+    return $this->frames[0] ?? NULL;
   }
 
   /**
index fe31b74b139b9af4b4d8fa729b456af7ff2d45ad..0d53d034ba372f201fc34cf8d270d84c500d5829 100644 (file)
@@ -100,7 +100,7 @@ trait GenericAssertionsTrait {
   public function assertArrayValueNotNull($key, &$list) {
     $this->assertArrayKeyExists($key, $list);
 
-    $value = isset($list[$key]) ? $list[$key] : NULL;
+    $value = $list[$key] ?? NULL;
     $this->assertTrue($value,
       sprintf("%s element not null?", $key)
     );
index 40da4389a90a1f0ad42c80248903836730d71ece..adca28b1b48aaab692db73ecd7b1bf91b1e164bc 100644 (file)
@@ -27,7 +27,7 @@ class Schema {
     $tables = $pdo->query($query);
     $result = [];
     foreach ($tables as $table) {
-      $result[] = isset($table['TABLE_NAME']) ? $table['TABLE_NAME'] : $table['table_name'];
+      $result[] = $table['TABLE_NAME'] ?? $table['table_name'];
     }
     return $result;
   }
index f6734a371c262f6d46fd99347b0e49663ad20fe2..d02aaa2d02ff22d897e8d876989f68c0e2d40ad0 100644 (file)
@@ -644,13 +644,13 @@ function _civicrm_api3_activity_fill_activity_contact_names(&$activities, $param
     $recordType = $typeMap[$activityContact['record_type_id']];
     if (in_array($recordType, ['target', 'assignee'])) {
       $activities[$activityContact['activity_id']][$recordType . '_contact_id'][] = $contactID;
-      $activities[$activityContact['activity_id']][$recordType . '_contact_name'][$contactID] = isset($activityContact['contact_id.display_name']) ? $activityContact['contact_id.display_name'] : '';
-      $activities[$activityContact['activity_id']][$recordType . '_contact_sort_name'][$contactID] = isset($activityContact['contact_id.sort_name']) ? $activityContact['contact_id.sort_name'] : '';
+      $activities[$activityContact['activity_id']][$recordType . '_contact_name'][$contactID] = $activityContact['contact_id.display_name'] ?? '';
+      $activities[$activityContact['activity_id']][$recordType . '_contact_sort_name'][$contactID] = $activityContact['contact_id.sort_name'] ?? '';
     }
     else {
       $activities[$activityContact['activity_id']]['source_contact_id'] = $contactID;
-      $activities[$activityContact['activity_id']]['source_contact_name'] = isset($activityContact['contact_id.display_name']) ? $activityContact['contact_id.display_name'] : '';
-      $activities[$activityContact['activity_id']]['source_contact_sort_name'] = isset($activityContact['contact_id.sort_name']) ? $activityContact['contact_id.sort_name'] : '';
+      $activities[$activityContact['activity_id']]['source_contact_name'] = $activityContact['contact_id.display_name'] ?? '';
+      $activities[$activityContact['activity_id']]['source_contact_sort_name'] = $activityContact['contact_id.sort_name'] ?? '';
     }
   }
 }
index c29d63bd34fc1889890a42254691cb7a86884db0..1e78d6796bbae0faf4e7d805d300ea2cc5d30454 100644 (file)
@@ -385,7 +385,7 @@ function _civicrm_api3_attachment_parse_params($params) {
 
   $isTrusted = empty($params['check_permissions']);
 
-  $returns = isset($params['return']) ? $params['return'] : [];
+  $returns = $params['return'] ?? [];
   $returns = is_array($returns) ? $returns : [$returns];
   $returnContent = in_array('content', $returns);
 
index cc535fda90c4fb983c6a22366dad22ed01132c72..1139f986143a1d1940b267b0af5f2f10da75156d 100644 (file)
@@ -82,7 +82,7 @@ function _civicrm_api3_case_contact_getlist_output($result, $request, $entity, $
         $row['case_id.subject'],
       ];
       if (!empty($request['image_field'])) {
-        $data['image'] = isset($row[$request['image_field']]) ? $row[$request['image_field']] : '';
+        $data['image'] = $row[$request['image_field']] ?? '';
       }
       $output[] = $data;
     }
index f3295353bf804f911f02e3309431ff8659c47bb8..ba581e57947526c3d6199e49436b29608c247613 100644 (file)
@@ -1036,7 +1036,7 @@ function civicrm_api3_contact_getquick($params) {
   while ($dao->fetch()) {
     $t = ['id' => $dao->id];
     foreach ($as as $k) {
-      $t[$k] = isset($dao->$k) ? $dao->$k : '';
+      $t[$k] = $dao->$k ?? '';
     }
     $t['data'] = $dao->data;
     // Replace keys with values when displaying fields from an option list
@@ -1570,7 +1570,7 @@ function _civicrm_api3_contact_getlist_output($result, $request) {
         $data['description'][] = implode(' ', $address);
       }
       if (!empty($request['image_field'])) {
-        $data['image'] = isset($row[$request['image_field']]) ? $row[$request['image_field']] : '';
+        $data['image'] = $row[$request['image_field']] ?? '';
       }
       else {
         $data['icon_class'] = $row['contact_type'];
index f87a2c670048b78a3035f4729bdf823374a9f3b8..cfc212a32800dfc203a3b97252b64e07993be5c9 100644 (file)
@@ -159,7 +159,7 @@ function civicrm_api3_entity_tag_replace($params) {
     // Lookup pre-existing records
     $preexisting = civicrm_api3('entity_tag', 'get', $baseParams);
     $preexisting = array_column($preexisting['values'], 'tag_id');
-    $toAdd = isset($params['tag_id']) ? $params['tag_id'] : array_column($params['values'], 'tag_id');
+    $toAdd = $params['tag_id'] ?? array_column($params['values'], 'tag_id');
     $toRemove = array_diff($preexisting, $toAdd);
 
     $result = [];
index 2473c36462b702136cac04c633c46fded54ebfe4..464bd09be028aad1af05c47a18075f3612241a82 100644 (file)
@@ -182,7 +182,7 @@ function _civicrm_api3_generic_getlist_output($result, $request, $entity, $field
         }
       };
       if (!empty($request['image_field'])) {
-        $data['image'] = isset($row[$request['image_field']]) ? $row[$request['image_field']] : '';
+        $data['image'] = $row[$request['image_field']] ?? '';
       }
       if (isset($row[$request['color_field']])) {
         $data['color'] = $row[$request['color_field']];
@@ -210,10 +210,10 @@ function _civicrm_api3_generic_getlist_postprocess($result, $request, &$values)
   if (!empty($result['values'])) {
     foreach (array_values($result['values']) as $num => $row) {
       foreach ($request['extra'] as $field) {
-        $values[$num]['extra'][$field] = isset($row[$field]) ? $row[$field] : NULL;
+        $values[$num]['extra'][$field] = $row[$field] ?? NULL;
       }
       foreach ($chains as $chain) {
-        $values[$num][$chain] = isset($row[$chain]) ? $row[$chain] : NULL;
+        $values[$num][$chain] = $row[$chain] ?? NULL;
       }
     }
   }
index ff73c62c615cdd033d88a8faeba7337195419ed9..72fdcf30b6f62b8c30022649d3cf02ca12c76a2c 100644 (file)
@@ -442,17 +442,17 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
 
   if (!empty($result['api.address.get.1']['count'])) {
     foreach ($addressFields as $fieldname) {
-      $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.1']['values'][0][$fieldname]) ? $result['api.address.get.1']['values'][0][$fieldname] : '';
+      $values['billing_' . $fieldname . '-' . $locationTypeID] = $result['api.address.get.1']['values'][0][$fieldname] ?? '';
     }
   }
   elseif (!empty($result['api.address.get.2']['count'])) {
     foreach ($addressFields as $fieldname) {
-      $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.2']['values'][0][$fieldname]) ? $result['api.address.get.2']['values'][0][$fieldname] : '';
+      $values['billing_' . $fieldname . '-' . $locationTypeID] = $result['api.address.get.2']['values'][0][$fieldname] ?? '';
     }
   }
   else {
     foreach ($addressFields as $fieldname) {
-      $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result[$fieldname]) ? $result[$fieldname] : '';
+      $values['billing_' . $fieldname . '-' . $locationTypeID] = $result[$fieldname] ?? '';
     }
   }
 
index 3f0f5848144c7b8daf8047525e4a79652da052ce..2d25eedea0815fd591631aea0f71b714d08b8bd4 100644 (file)
@@ -135,7 +135,7 @@ function _civicrm_api3_uf_group_getlist_output($result, $request, $entity, $fiel
         }
       };
       if (!empty($request['image_field'])) {
-        $data['image'] = isset($row[$request['image_field']]) ? $row[$request['image_field']] : '';
+        $data['image'] = $row[$request['image_field']] ?? '';
       }
       $output[] = $data;
     }
index dff79069f40ae90664f266ecd761f7a2231985cf..3d719ea6fd50bf9bc030d040899ba0581c7b15de 100644 (file)
@@ -211,7 +211,7 @@ class civicrm_cli {
         }
         // all other arguments are parameters
         $key = ltrim($arg, '--');
-        $this->_params[$key] = isset($value) ? $value : NULL;
+        $this->_params[$key] = $value ?? NULL;
       }
     }
     return TRUE;
index 3bd68119aa52e89241228a15d3650a75df7b08e6..0932b1902b58e85622a2632f580a9278ac00adea 100644 (file)
@@ -67,7 +67,7 @@ function civicrm_main(&$config) {
   global $sqlPath, $crmPath, $cmsPath, $installType;
 
   if ($installType == 'drupal') {
-    $siteDir = isset($config['site_dir']) ? $config['site_dir'] : getSiteDir($cmsPath, $_SERVER['SCRIPT_FILENAME']);
+    $siteDir = $config['site_dir'] ?? getSiteDir($cmsPath, $_SERVER['SCRIPT_FILENAME']);
     civicrm_setup($cmsPath . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . $siteDir . DIRECTORY_SEPARATOR . 'files'
     );
   }
@@ -212,7 +212,7 @@ function civicrm_config(&$config) {
     'dbName' => addslashes($config['mysql']['database']),
   );
 
-  $params['baseURL'] = isset($config['base_url']) ? $config['base_url'] : civicrm_cms_base();
+  $params['baseURL'] = $config['base_url'] ?? civicrm_cms_base();
   if ($installType == 'drupal' && defined('VERSION')) {
     if (version_compare(VERSION, '8.0') >= 0) {
       $params['cms'] = 'Drupal';
index c7d3a341e586758a54be40eb243c91d046602262..7f3a0ad508207117fa16dd6e8fc71b506b02df0d 100644 (file)
@@ -129,7 +129,7 @@ $installTypeToUF = array(
   'backdrop' => 'Backdrop',
 );
 
-$uf = (isset($installTypeToUF[$installType]) ? $installTypeToUF[$installType] : 'Drupal');
+$uf = ($installTypeToUF[$installType] ?? 'Drupal');
 define('CIVICRM_UF', $uf);
 
 // Set the Locale (required by CRM_Core_Config)
@@ -1916,7 +1916,7 @@ function getSiteDir($cmsPath, $str) {
     preg_quote($modules, CIVICRM_DIRECTORY_SEPARATOR) . "/",
     $_SERVER['SCRIPT_FILENAME'], $matches
   );
-  $siteDir = isset($matches[1]) ? $matches[1] : 'default';
+  $siteDir = $matches[1] ?? 'default';
 
   if (strtolower($siteDir) == 'all') {
     // For this case - use drupal's way of finding out multi-site directory
index 0066bfd157882a1c286bb7c0f11ad670e5b81709..54979fdf3c87564e3a7846f897450c23e0da9f8d 100644 (file)
@@ -37,7 +37,7 @@ uasort($msgs, function($a, $b) {
   <?php foreach ($msgs as $msg):?>
   <tr class="<?php echo 'reqSeverity-' . $msg['severity']; ?>">
     <td><?php echo htmlentities($_tpl_block['severity_labels'][$msg['severity']]); ?></td>
-    <td><?php echo htmlentities(isset($_tpl_block['section_labels'][$msg['section']]) ? $_tpl_block['section_labels'][$msg['section']] : $msg['section']); ?></td>
+    <td><?php echo htmlentities($_tpl_block['section_labels'][$msg['section']] ?? $msg['section']); ?></td>
     <td><?php echo htmlentities($msg['name']); ?></td>
     <td><?php echo htmlentities($msg['message']); ?></td>
   </tr>
index 5e8090a4b4618488f70344526c35723437d01b8e..0f5ab95205b02ca0fc6893cb2e4f6b116821a59b 100644 (file)
@@ -47,7 +47,7 @@ class DrupalUtil {
     preg_quote($modules, DIRECTORY_SEPARATOR) . "/",
     $_SERVER['SCRIPT_FILENAME'], $matches
     );
-    $siteDir = isset($matches[1]) ? $matches[1] : 'default';
+    $siteDir = $matches[1] ?? 'default';
 
     if (strtolower($siteDir) == 'all') {
     // For this case - use drupal's way of finding out multi-site directory
index 68100aef34ce15e4ae3247321cdba78028eec2f9..717421e7a680819d42a232fd73b91b325050b9a7 100644 (file)
@@ -176,7 +176,7 @@ class Model {
     $field = array_merge($defaults, $field);
 
     if (array_key_exists('value', $field) || !array_key_exists($field['name'], $this->values)) {
-      $this->values[$field['name']] = isset($field['value']) ? $field['value'] : NULL;
+      $this->values[$field['name']] = $field['value'] ?? NULL;
       unset($field['value']);
     }
 
@@ -202,10 +202,10 @@ class Model {
    */
   public function getField($field, $property = NULL) {
     if ($property) {
-      return isset($this->fields[$field][$property]) ? $this->fields[$field][$property] : NULL;
+      return $this->fields[$field][$property] ?? NULL;
     }
     else {
-      return isset($this->fields[$field]) ? $this->fields[$field] : NULL;
+      return $this->fields[$field] ?? NULL;
     }
   }
 
index 841c7c71c14651d12de3eac727cb18e23c01a808..0d1d1a0d4abd198ed7404d33735baff3fe8e47d1 100644 (file)
@@ -209,7 +209,7 @@ class SetupController implements SetupControllerInterface {
   }
 
   public function getUrl($name) {
-    return isset($this->urls[$name]) ? $this->urls[$name] : NULL;
+    return $this->urls[$name] ?? NULL;
   }
 
   /**