Skip to content

Commit

Permalink
Remove unused parameter, pass-by-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Feb 11, 2022
1 parent 9a17729 commit 648bdb1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Inline/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function preProcess() {
$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') {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Inline/IM.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function preProcess() {
$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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Inline/OpenID.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function preProcess() {
$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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Inline/Phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function preProcess() {
$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);
}

/**
Expand Down
8 changes: 3 additions & 5 deletions CRM/Core/BAO/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function &getValues($blockName, $params) {
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);
Expand All @@ -67,7 +67,7 @@ public static function &getValues($blockName, $params) {
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);
}
}
Expand All @@ -81,13 +81,11 @@ public static function &getValues($blockName, $params) {
*
* @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();
Expand Down

0 comments on commit 648bdb1

Please sign in to comment.