Use ?? operator instead of CRM_Utils_Array::value() when fetching ids
[civicrm-core.git] / CRM / Core / BAO / Tag.php
index 57623f1d727b84d5a29f864395d058bfe7d372e4..623dd412dee1d8395bf91d3984ffd71ed0d403fc 100644 (file)
@@ -393,7 +393,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
    *   object on success, otherwise null
    */
   public static function add(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('tag', $ids));
+    $id = $params['id'] ?? $ids['tag'] ?? NULL;
     if (!$id && !self::dataExists($params)) {
       return NULL;
     }