From 026e03081b065d37ecb57177a1ed0ef326c02742 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frank=20J=2E=20G=C3=B3mez?= Date: Wed, 17 Aug 2016 11:29:18 -0400 Subject: [PATCH] CRM-19068: Code style change. Reduced verbosity and removed the dreaded $dc (or $dont_care) variable. --- CRM/Contact/BAO/Group.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index b2b689d238..15aa5fa5cb 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -385,13 +385,9 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { // CRM-19068. // Validate parents parameter when creating group. if (!empty($params['parents'])) { - if (is_array($params['parents'])) { - foreach ($params['parents'] as $parent => $dc) { - CRM_Utils_Type::validate($parent, 'Integer'); - } - } - else { - CRM_Utils_Type::validate($params['parents'], 'Integer'); + $parents = is_array($params['parents']) ? array_keys($params['parents']) : (array) $params['parents']; + foreach ($parents as $parent) { + CRM_Utils_Type::validate($parent, 'Integer'); } } $group = new CRM_Contact_BAO_Group(); -- 2.25.1