Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused parameter, pass-by-ref #22756

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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