From: larssandergreen Date: Sat, 5 Aug 2023 19:29:43 +0000 (-0600) Subject: Remove unused parse function X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=53f47f5584087757d212256a8c684a1ca8e31e62;p=civicrm-core.git Remove unused parse function --- diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php index 86b80dd733..a0c5517424 100644 --- a/CRM/Utils/Mail/Incoming.php +++ b/CRM/Utils/Mail/Incoming.php @@ -285,41 +285,6 @@ class CRM_Utils_Mail_Incoming { return $name . "<{$address->email}>"; } - /** - * @param $file - * - * @return array - * @throws Exception - */ - public function &parse(&$file) { - - // check that the file exists and has some content - if (!file_exists($file) || - !trim(file_get_contents($file)) - ) { - return CRM_Core_Error::createAPIError(ts('%1 does not exists or is empty', - [1 => $file] - )); - } - - // explode email to digestable format - $set = new ezcMailFileSet([$file]); - $parser = new ezcMailParser(); - $mail = $parser->parseMail($set); - - if (!$mail) { - return CRM_Core_Error::createAPIError(ts('%1 could not be parsed', - [1 => $file] - )); - } - - // since we only have one fileset - $mail = $mail[0]; - - $mailParams = self::parseMailingObject($mail); - return $mailParams; - } - /** * @param $mail * @param $createContact