[NFC] Remove some more of the old cvs blocks
[civicrm-core.git] / Civi / Api4 / Utils / ArrayInsertionUtil.php
index 0011a01b32d53a7b6151b915952caa17d6dcf727..951f769790a0691416646bc5f67005138dd84191 100644 (file)
  +--------------------------------------------------------------------+
  */
 
+namespace Civi\Api4\Utils;
+
 /**
+ * Class ArrayInsertionUtil
  *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
- * $Id$
- *
+ * @package Civi\Api4\Utils
  */
-
-
-namespace Civi\Api4\Utils;
-
-use CRM_Utils_Array as UtilsArray;
-
 class ArrayInsertionUtil {
 
   /**
@@ -67,11 +61,11 @@ class ArrayInsertionUtil {
    * @return array|mixed
    */
   private static function filterValues($parentArray, $isMulti, $values) {
-    $parentID = UtilsArray::value('id', $parentArray);
+    $parentID = $parentArray['id'] ?? NULL;
 
     if ($parentID) {
       $values = array_filter($values, function ($value) use ($parentID) {
-        return UtilsArray::value('_parent_id', $value) == $parentID;
+        return ($value['_parent_id'] ?? NULL) == $parentID;
       });
     }