Merge branch 4.5 into master
[civicrm-core.git] / CRM / Mailing / MailStore / Imap.php
index 4489e384afd85382c9f667ba83850d4fee81ec1e..d4aacc00687418bd1be481b17dca4ab3e3033318 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
 
 require_once 'ezc/Base/src/ezc_bootstrap.php';
 require_once 'ezc/autoload/mail_autoload.php';
+
+/**
+ * Class CRM_Mailing_MailStore_Imap
+ */
 class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
 
   /**
    * Connect to the supplied IMAP server and make sure the two mailboxes exist
    *
-   * @param string $host      host to connect to
-   * @param string $username  authentication username
-   * @param string $password  authentication password
-   * @param bool   $ssl       whether to use IMAP or IMAPS
-   * @param string $folder    name of the inbox folder
+   * @param string $host
+   *   Host to connect to.
+   * @param string $username
+   *   Authentication username.
+   * @param string $password
+   *   Authentication password.
+   * @param bool $ssl
+   *   Whether to use IMAP or IMAPS.
+   * @param string $folder
+   *   Name of the inbox folder.
    *
-   * @return void
+   * @return \CRM_Mailing_MailStore_Imap
    */
-  function __construct($host, $username, $password, $ssl = TRUE, $folder = 'INBOX') {
+  public function __construct($host, $username, $password, $ssl = TRUE, $folder = 'INBOX') {
     // default to INBOX if an empty string
     if (!$folder) {
       $folder = 'INBOX';
@@ -65,9 +74,9 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
     $this->_transport->authenticate($username, $password);
     $this->_transport->selectMailbox($folder);
 
-    $this->_ignored   = implode($this->_transport->getHierarchyDelimiter(), array($folder, 'CiviMail', 'ignored'));
+    $this->_ignored = implode($this->_transport->getHierarchyDelimiter(), array($folder, 'CiviMail', 'ignored'));
     $this->_processed = implode($this->_transport->getHierarchyDelimiter(), array($folder, 'CiviMail', 'processed'));
-    $boxes            = $this->_transport->listMailboxes();
+    $boxes = $this->_transport->listMailboxes();
 
     if ($this->_debug) {
       print 'mailboxes found: ' . implode(', ', $boxes) . "\n";
@@ -85,18 +94,19 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
   /**
    * Expunge the messages marked for deletion, CRM-7356
    */
-  function expunge() {
+  public function expunge() {
     $this->_transport->expunge();
   }
 
   /**
    * Move the specified message to the ignored folder
    *
-   * @param integer $nr  number of the message to move
+   * @param int $nr
+   *   Number of the message to move.
    *
    * @return void
    */
-  function markIgnored($nr) {
+  public function markIgnored($nr) {
     if ($this->_debug) {
       print "setting $nr as seen and moving it to the ignored mailbox\n";
     }
@@ -108,11 +118,12 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
   /**
    * Move the specified message to the processed folder
    *
-   * @param integer $nr  number of the message to move
+   * @param int $nr
+   *   Number of the message to move.
    *
    * @return void
    */
-  function markProcessed($nr) {
+  public function markProcessed($nr) {
     if ($this->_debug) {
       print "setting $nr as seen and moving it to the processed mailbox\n";
     }
@@ -120,5 +131,5 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
     $this->_transport->copyMessages($nr, $this->_processed);
     $this->_transport->delete($nr);
   }
-}
 
+}