From: Eileen McNaughton Date: Thu, 7 Sep 2023 01:20:49 +0000 (+1200) Subject: Remove unused parameter X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2dc70de186c0afb0b8b27969ab04d971165b0c6c;p=civicrm-core.git Remove unused parameter --- diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php index 23a4e803a2..7f27bab670 100644 --- a/CRM/Utils/Mail/Incoming.php +++ b/CRM/Utils/Mail/Incoming.php @@ -367,8 +367,7 @@ class CRM_Utils_Mail_Incoming { $contactID = self::getContactID($subParam['email'], $subParam['name'], - $createContact, - $mail + $createContact ); $subParam['id'] = $contactID ?: NULL; } @@ -397,11 +396,12 @@ class CRM_Utils_Mail_Incoming { * @param string $email * @param string $name * @param bool $create - * @param string $mail + * + * @internal core use only (only use outside this class is in core unit tests). * * @return int|null */ - public static function getContactID($email, $name, $create, &$mail) { + public static function getContactID($email, $name, $create) { $dao = CRM_Contact_BAO_Contact::matchContactOnEmail($email, 'Individual'); $contactID = NULL; diff --git a/tests/phpunit/CRM/Utils/Mail/IncomingTest.php b/tests/phpunit/CRM/Utils/Mail/IncomingTest.php index aebc2fab72..14ac2b4cef 100644 --- a/tests/phpunit/CRM/Utils/Mail/IncomingTest.php +++ b/tests/phpunit/CRM/Utils/Mail/IncomingTest.php @@ -46,7 +46,7 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase { public function testEmailUseExistentIndividualContact(): void { $expectedContactId = $this->individualCreate(['email' => $this->email]); - $receivedContactId = CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE, $mail); + $receivedContactId = CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE); $this->assertEquals($expectedContactId, $receivedContactId); } @@ -58,7 +58,7 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase { $contact = CRM_Contact_BAO_Contact::matchContactOnEmail($this->email, 'Individual'); $this->assertNull($contact); - CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE, $mail); + CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE); $contact = CRM_Contact_BAO_Contact::matchContactOnEmail($this->email, 'Individual'); $this->assertNotNull($contact); @@ -70,7 +70,7 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase { public function testEmailUseExistentOrganizationContact(): void { $expectedContactId = $this->organizationCreate(['email' => $this->email]); - $receivedContactId = CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE, $mail); + $receivedContactId = CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE); $this->assertEquals($expectedContactId, $receivedContactId); } @@ -82,7 +82,7 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase { $individualContactId = $this->individualCreate(['email' => $this->email]); $this->organizationCreate(['email' => $this->email]); - $receivedContactId = CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE, $mail); + $receivedContactId = CRM_Utils_Mail_Incoming::getContactID($this->email, $this->name, TRUE); $this->assertEquals($individualContactId, $receivedContactId); }