Remove unused parameter
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 7 Sep 2023 01:20:49 +0000 (13:20 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 7 Sep 2023 03:18:14 +0000 (15:18 +1200)
CRM/Utils/Mail/Incoming.php
tests/phpunit/CRM/Utils/Mail/IncomingTest.php

index 23a4e803a2bde243863f08d22eeb96b9acbfb0e5..7f27bab6700769e064252e75f3c42183d656fd48 100644 (file)
@@ -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;
index aebc2fab72e25358dfb68b4b167d1ae4b1ff18ad..14ac2b4cef9353ae223ebeb5c3b0db0ceae94761 100644 (file)
@@ -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);
   }