From a88d9edd2dfedc589055f449c905ad7d857a1b0f Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 11 Feb 2022 17:17:36 +1300 Subject: [PATCH] Remove unused parameter, pass-by-ref --- CRM/Contact/Form/Inline/Email.php | 2 +- CRM/Contact/Form/Inline/IM.php | 2 +- CRM/Contact/Form/Inline/OpenID.php | 2 +- CRM/Contact/Form/Inline/Phone.php | 2 +- CRM/Core/BAO/Block.php | 8 +++----- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CRM/Contact/Form/Inline/Email.php b/CRM/Contact/Form/Inline/Email.php index 3b59174826..78ca2fbb5b 100644 --- a/CRM/Contact/Form/Inline/Email.php +++ b/CRM/Contact/Form/Inline/Email.php @@ -49,7 +49,7 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline { $email = new CRM_Core_BAO_Email(); $email->contact_id = $this->_contactId; - $this->_emails = CRM_Core_BAO_Block::retrieveBlock($email, NULL); + $this->_emails = CRM_Core_BAO_Block::retrieveBlock($email); // Check if this contact has a first/last/organization/household name if ($this->_contactType == 'Individual') { diff --git a/CRM/Contact/Form/Inline/IM.php b/CRM/Contact/Form/Inline/IM.php index 4ab5fd9531..bf0fb219dd 100644 --- a/CRM/Contact/Form/Inline/IM.php +++ b/CRM/Contact/Form/Inline/IM.php @@ -42,7 +42,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline { $im = new CRM_Core_BAO_IM(); $im->contact_id = $this->_contactId; - $this->_ims = CRM_Core_BAO_Block::retrieveBlock($im, NULL); + $this->_ims = CRM_Core_BAO_Block::retrieveBlock($im); } /** diff --git a/CRM/Contact/Form/Inline/OpenID.php b/CRM/Contact/Form/Inline/OpenID.php index 1f60b8db23..330bc520eb 100644 --- a/CRM/Contact/Form/Inline/OpenID.php +++ b/CRM/Contact/Form/Inline/OpenID.php @@ -42,7 +42,7 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline { $openid = new CRM_Core_BAO_OpenID(); $openid->contact_id = $this->_contactId; - $this->_openids = CRM_Core_BAO_Block::retrieveBlock($openid, NULL); + $this->_openids = CRM_Core_BAO_Block::retrieveBlock($openid); } /** diff --git a/CRM/Contact/Form/Inline/Phone.php b/CRM/Contact/Form/Inline/Phone.php index 3ca3255a71..ff48187dfb 100644 --- a/CRM/Contact/Form/Inline/Phone.php +++ b/CRM/Contact/Form/Inline/Phone.php @@ -42,7 +42,7 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline { $phone = new CRM_Core_BAO_Phone(); $phone->contact_id = $this->_contactId; - $this->_phones = CRM_Core_BAO_Block::retrieveBlock($phone, NULL); + $this->_phones = CRM_Core_BAO_Block::retrieveBlock($phone); } /** diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index 4929e323fd..190ca1dad1 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -54,7 +54,7 @@ class CRM_Core_BAO_Block { if (!$block->contact_id) { throw new CRM_Core_Exception('Invalid Contact ID parameter passed'); } - $blocks = self::retrieveBlock($block, $blockName); + $blocks = self::retrieveBlock($block); } else { $blockIds = self::getBlockIds($blockName, NULL, $params); @@ -67,7 +67,7 @@ class CRM_Core_BAO_Block { foreach ($blockIds as $blockId) { $block = new $BAOString(); $block->id = $blockId['id']; - $getBlocks = self::retrieveBlock($block, $blockName); + $getBlocks = self::retrieveBlock($block); $blocks[$count++] = array_pop($getBlocks); } } @@ -81,13 +81,11 @@ class CRM_Core_BAO_Block { * * @param Object $block * Typically a Phone|Email|IM|OpenID object. - * @param string $blockName - * Name of the above object. * * @return array * Array of $block objects. */ - public static function retrieveBlock(&$block, $blockName) { + public static function retrieveBlock($block) { // we first get the primary location due to the order by clause $block->orderBy('is_primary desc, id'); $block->find(); -- 2.25.1