@@ -283,7 +283,7 @@ public function connect($attempts = 3) {
283283 $ this ->disconnect ();
284284
285285 try {
286- $ this ->connection = imap_open (
286+ $ this ->connection = \ imap_open (
287287 $ this ->getAddress (),
288288 $ this ->username ,
289289 $ this ->password ,
@@ -293,7 +293,7 @@ public function connect($attempts = 3) {
293293 );
294294 $ this ->connected = !!$ this ->connection ;
295295 } catch (\ErrorException $ e ) {
296- $ errors = imap_errors ();
296+ $ errors = \ imap_errors ();
297297 $ message = $ e ->getMessage ().'. ' .implode ("; " , (is_array ($ errors ) ? $ errors : array ()));
298298
299299 throw new ConnectionFailedException ($ message );
@@ -309,8 +309,8 @@ public function connect($attempts = 3) {
309309 */
310310 public function disconnect () {
311311 if ($ this ->isConnected () && $ this ->connection !== false && is_integer ($ this ->connection ) === false ) {
312- $ this ->errors = array_merge ($ this ->errors , imap_errors () ?: []);
313- $ this ->connected = !imap_close ($ this ->connection , IMAP ::CL_EXPUNGE );
312+ $ this ->errors = array_merge ($ this ->errors , \ imap_errors () ?: []);
313+ $ this ->connected = !\ imap_close ($ this ->connection , IMAP ::CL_EXPUNGE );
314314 }
315315
316316 return $ this ;
@@ -360,7 +360,7 @@ public function getFolders($hierarchical = true, $parent_folder = null) {
360360
361361 $ pattern = $ parent_folder .($ hierarchical ? '% ' : '* ' );
362362
363- $ items = imap_getmailboxes ($ this ->connection , $ this ->getAddress (), $ pattern );
363+ $ items = \ imap_getmailboxes ($ this ->connection , $ this ->getAddress (), $ pattern );
364364 if (is_array ($ items )){
365365 foreach ($ items as $ item ) {
366366 $ folder = new Folder ($ this , $ item );
@@ -399,7 +399,7 @@ public function openFolder($folder_path, $attempts = 3) {
399399 if ($ this ->active_folder !== $ folder_path ) {
400400 $ this ->active_folder = $ folder_path ;
401401
402- imap_reopen ($ this ->getConnection (), $ folder_path , $ this ->getOptions (), $ attempts );
402+ \ imap_reopen ($ this ->getConnection (), $ folder_path , $ this ->getOptions (), $ attempts );
403403 }
404404 }
405405
@@ -413,7 +413,7 @@ public function openFolder($folder_path, $attempts = 3) {
413413 */
414414 public function createFolder ($ name , $ expunge = true ) {
415415 $ this ->checkConnection ();
416- $ status = imap_createmailbox ($ this ->getConnection (), $ this ->getAddress () . imap_utf7_encode ($ name ));
416+ $ status = \ imap_createmailbox ($ this ->getConnection (), $ this ->getAddress () . \ imap_utf7_encode ($ name ));
417417 if ($ expunge ) $ this ->expunge ();
418418
419419 return $ status ;
@@ -430,7 +430,7 @@ public function createFolder($name, $expunge = true) {
430430 */
431431 public function renameFolder ($ old_name , $ new_name , $ expunge = true ) {
432432 $ this ->checkConnection ();
433- $ status = imap_renamemailbox ($ this ->getConnection (), $ this ->getAddress () . imap_utf7_encode ($ old_name ), $ this ->getAddress () . imap_utf7_encode ($ new_name ));
433+ $ status = \ imap_renamemailbox ($ this ->getConnection (), $ this ->getAddress () . \ imap_utf7_encode ($ old_name ), $ this ->getAddress () . \ imap_utf7_encode ($ new_name ));
434434 if ($ expunge ) $ this ->expunge ();
435435
436436 return $ status ;
@@ -446,7 +446,7 @@ public function renameFolder($old_name, $new_name, $expunge = true) {
446446 */
447447 public function deleteFolder ($ name , $ expunge = true ) {
448448 $ this ->checkConnection ();
449- $ status = imap_deletemailbox ($ this ->getConnection (), $ this ->getAddress () . imap_utf7_encode ($ name ));
449+ $ status = \ imap_deletemailbox ($ this ->getConnection (), $ this ->getAddress () . \ imap_utf7_encode ($ name ));
450450 if ($ expunge ) $ this ->expunge ();
451451
452452 return $ status ;
@@ -522,7 +522,7 @@ public function searchMessages(array $where, Folder $folder, $fetch_options = nu
522522 }
523523
524524 /**
525- * Get option for imap_open and imap_reopen.
525+ * Get option for \ imap_open and \ imap_reopen.
526526 * It supports only isReadOnly feature.
527527 *
528528 * @return int
@@ -560,7 +560,7 @@ protected function getAddress() {
560560 */
561561 public function getQuota () {
562562 $ this ->checkConnection ();
563- return imap_get_quota ($ this ->getConnection (), 'user. ' .$ this ->username );
563+ return \ imap_get_quota ($ this ->getConnection (), 'user. ' .$ this ->username );
564564 }
565565
566566 /**
@@ -573,7 +573,7 @@ public function getQuota() {
573573 */
574574 public function getQuotaRoot ($ quota_root = 'INBOX ' ) {
575575 $ this ->checkConnection ();
576- return imap_get_quotaroot ($ this ->getConnection (), $ quota_root );
576+ return \ imap_get_quotaroot ($ this ->getConnection (), $ quota_root );
577577 }
578578
579579 /**
@@ -584,7 +584,7 @@ public function getQuotaRoot($quota_root = 'INBOX') {
584584 */
585585 public function countMessages () {
586586 $ this ->checkConnection ();
587- return imap_num_msg ($ this ->connection );
587+ return \ imap_num_msg ($ this ->connection );
588588 }
589589
590590 /**
@@ -595,7 +595,7 @@ public function countMessages() {
595595 */
596596 public function countRecentMessages () {
597597 $ this ->checkConnection ();
598- return imap_num_recent ($ this ->connection );
598+ return \ imap_num_recent ($ this ->connection );
599599 }
600600
601601 /**
@@ -604,7 +604,7 @@ public function countRecentMessages() {
604604 * @return array
605605 */
606606 public function getAlerts () {
607- return imap_alerts ();
607+ return \ imap_alerts ();
608608 }
609609
610610 /**
@@ -613,7 +613,7 @@ public function getAlerts() {
613613 * @return array
614614 */
615615 public function getErrors () {
616- $ this ->errors = array_merge ($ this ->errors , imap_errors () ?: []);
616+ $ this ->errors = array_merge ($ this ->errors , \ imap_errors () ?: []);
617617
618618 return $ this ->errors ;
619619 }
@@ -624,7 +624,7 @@ public function getErrors() {
624624 * @return string
625625 */
626626 public function getLastError () {
627- return imap_last_error ();
627+ return \ imap_last_error ();
628628 }
629629
630630 /**
@@ -635,7 +635,7 @@ public function getLastError() {
635635 */
636636 public function expunge () {
637637 $ this ->checkConnection ();
638- return imap_expunge ($ this ->connection );
638+ return \ imap_expunge ($ this ->connection );
639639 }
640640
641641 /**
@@ -652,7 +652,7 @@ public function expunge() {
652652 */
653653 public function checkCurrentMailbox () {
654654 $ this ->checkConnection ();
655- return imap_check ($ this ->connection );
655+ return \ imap_check ($ this ->connection );
656656 }
657657
658658 /**
@@ -665,7 +665,7 @@ public function checkCurrentMailbox() {
665665 */
666666 public function setTimeout ($ type , $ timeout ) {
667667 if (0 <= $ type && $ type <= 4 ) {
668- return imap_timeout ($ type , $ timeout );
668+ return \ imap_timeout ($ type , $ timeout );
669669 }
670670
671671 throw new InvalidImapTimeoutTypeException ("Invalid imap timeout type provided. " );
@@ -680,7 +680,7 @@ public function setTimeout($type, $timeout) {
680680 */
681681 public function getTimeout ($ type ){
682682 if (0 <= $ type && $ type <= 4 ) {
683- return imap_timeout ($ type );
683+ return \ imap_timeout ($ type );
684684 }
685685
686686 throw new InvalidImapTimeoutTypeException ("Invalid imap timeout type provided. " );
0 commit comments