1- <?php
1+ <?php namespace PhpImap ;
2+
3+ use stdClass ;
24
35/**
46 * @see https://github.com/barbushin/php-imap
57 * @author Barbushin Sergey http://linkedin.com/in/barbushin
68 */
7- class ImapMailbox {
9+ class Mailbox {
810
911 protected $ imapPath ;
1012 protected $ imapLogin ;
@@ -62,7 +64,7 @@ public function getImapStream($forceConnection = true) {
6264 protected function initImapStream () {
6365 $ imapStream = @imap_open ($ this ->imapPath , $ this ->imapLogin , $ this ->imapPassword , $ this ->imapOptions , $ this ->imapRetriesNum , $ this ->imapParams );
6466 if (!$ imapStream ) {
65- throw new ImapMailboxException ('Connection error: ' . imap_last_error ());
67+ throw new Exception ('Connection error: ' . imap_last_error ());
6668 }
6769 return $ imapStream ;
6870 }
@@ -106,7 +108,7 @@ public function createMailbox() {
106108 * This function returns an object containing status information.
107109 * The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity.
108110 *
109- * @return stdClass | FALSE if the box doesn't exist
111+ * @return stdClass if the box doesn't exist
110112 */
111113
112114 public function statusMailbox () {
@@ -253,7 +255,7 @@ public function markMailsAsImportant(array $mailId) {
253255 * Causes a store to add the specified flag to the flags set for the mails in the specified sequence.
254256 *
255257 * @param array $mailsIds
256- * @param $flag Flags which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060.
258+ * @param string $flag which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060.
257259 * @return bool
258260 */
259261 public function setFlag (array $ mailsIds , $ flag ) {
@@ -264,7 +266,7 @@ public function setFlag(array $mailsIds, $flag) {
264266 * Cause a store to delete the specified flag to the flags set for the mails in the specified sequence.
265267 *
266268 * @param array $mailsIds
267- * @param $flag Flags which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060.
269+ * @param string $flag which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060.
268270 * @return bool
269271 */
270272 public function clearFlag (array $ mailsIds , $ flag ) {
@@ -591,6 +593,6 @@ public function __destruct() {
591593 }
592594}
593595
594- class ImapMailboxException extends Exception {
596+ class Exception extends \ Exception {
595597
596598}
0 commit comments