make methods formatValues() and matchContact() static

This commit is contained in:
Marc Michalsky forumZFD 2020-12-15 16:12:08 +01:00
parent 2317c7e8e1
commit 12199ad8a6
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -223,7 +223,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
* *
* @throws Exception * @throws Exception
*/ */
protected function formatValues(array &$values, string $direction) { public static function formatValues(array &$values, string $direction) {
if ($direction == self::IN) { if ($direction == self::IN) {
@ -248,7 +248,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
} }
if ($values['user_name']) { if ($values['user_name']) {
$values['contact_id'] = $this->matchContact( $values['contact_id'] = self::matchContact(
$values['user_name'], $values['user_name'],
$values['user_email'] $values['user_email']
); );
@ -361,7 +361,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
* @return int|null * @return int|null
* Returns a contact id * Returns a contact id
*/ */
private function matchContact(string $names, string $email) { private static function matchContact(string $names, string $email): ?int {
$names = StringOps::split_names($names); // Hopefully just a temporary solution $names = StringOps::split_names($names); // Hopefully just a temporary solution
$firstnames = $names['firstnames']; $firstnames = $names['firstnames'];
$lastname = $names['lastname']; $lastname = $names['lastname'];