Cleanup uses of CRM_Utils_Array::value related to numbers
[civicrm-core.git] / CRM / Core / BAO / Block.php
index 001787d2f3499fbeaacc36cc1ba092cc71f90965..86210384041c3ded599594b45206e6e05bfb7ac8 100644 (file)
@@ -312,7 +312,7 @@ class CRM_Core_BAO_Block {
       }
       $contactFields = [
         'contact_id' => $contactId,
-        'location_type_id' => CRM_Utils_Array::value('location_type_id', $value),
+        'location_type_id' => $value['location_type_id'] ?? NULL,
       ];
 
       $contactFields['is_primary'] = 0;
@@ -399,7 +399,7 @@ class CRM_Core_BAO_Block {
     }
 
     // contact_id in params might be empty or the string 'null' so cast to integer
-    $contactId = (int) CRM_Utils_Array::value('contact_id', $params);
+    $contactId = (int) ($params['contact_id'] ?? 0);
     // If id is set & we haven't been passed a contact_id, retrieve it
     if (!empty($params['id']) && !isset($params['contact_id'])) {
       $entity = new $class();