]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Email.php
Log the command, not the module
[friendica.git] / src / Protocol / Email.php
index f3a3736ad31bd07475f0b197935a8a5a0ab8f0e7..db22b76973b736ef86f9ecb6a591aca081771c07 100644 (file)
@@ -38,10 +38,10 @@ class Email
         * @param string $mailbox  The mailbox name
         * @param string $username The username
         * @param string $password The password
-        * @return Connection
+        * @return Connection|resource
         * @throws \Exception
         */
-       public static function connect($mailbox, $username, $password): Connection
+       public static function connect($mailbox, $username, $password)
        {
                if (!function_exists('imap_open')) {
                        return false;
@@ -63,8 +63,8 @@ class Email
        }
 
        /**
-        * @param Connection $mbox       mailbox
-        * @param string     $email_addr email
+        * @param Connection|resource $mbox       mailbox
+        * @param string              $email_addr email
         * @return array
         * @throws \Exception
         */
@@ -113,20 +113,20 @@ class Email
        }
 
        /**
-        * @param Connection $mbox mailbox
-        * @param integer    $uid  user id
+        * @param Connection|resource $mbox mailbox
+        * @param integer             $uid  user id
         * @return mixed
         */
-       public static function messageMeta(Connection $mbox, $uid)
+       public static function messageMeta($mbox, $uid)
        {
                $ret = (($mbox && $uid) ? @imap_fetch_overview($mbox, $uid, FT_UID) : [[]]); // POSSIBLE CLEANUP --> array(array()) is probably redundant now
                return (count($ret)) ? $ret : [];
        }
 
        /**
-        * @param Connection $mbox  mailbox
-        * @param integer    $uid   user id
-        * @param string     $reply reply
+        * @param Connection|resource $mbox  mailbox
+        * @param integer             $uid   user id
+        * @param string              $reply reply
         * @return array
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
@@ -211,14 +211,14 @@ class Email
        /**
         * fetch the specified message part number with the specified subtype
         *
-        * @param Connection $mbox    mailbox
-        * @param integer    $uid     user id
-        * @param object     $p       parts
-        * @param integer    $partno  part number
-        * @param string     $subtype sub type
+        * @param Connection|resource $mbox    mailbox
+        * @param integer             $uid     user id
+        * @param object              $p       parts
+        * @param integer             $partno  part number
+        * @param string              $subtype sub type
         * @return string
         */
-       private static function messageGetPart(Connection $mbox, $uid, $p, $partno, $subtype)
+       private static function messageGetPart($mbox, $uid, $p, $partno, $subtype)
        {
                // $partno = '1', '2', '2.1', '2.1.3', etc for multipart, 0 if simple
                global $htmlmsg,$plainmsg,$charset,$attachments;