File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,18 @@ class Client {
8989
9090 /**
9191 * Connected parameter
92+ *
9293 * @var bool
9394 */
9495 protected $ connected = false ;
9596
97+ /**
98+ * IMAP errors that might have ben occurred
99+ *
100+ * @var array $errors
101+ */
102+ protected $ errors = [];
103+
96104 /**
97105 * Client constructor.
98106 *
@@ -216,6 +224,7 @@ public function connect($attempts = 3) {
216224 */
217225 public function disconnect () {
218226 if ($ this ->isConnected ()) {
227+ $ this ->errors = array_merge ($ this ->errors , imap_errors () ?: []);
219228 $ this ->connected = ! imap_close ($ this ->connection , CL_EXPUNGE );
220229 }
221230
@@ -451,7 +460,9 @@ public function getAlerts(){
451460 * @return array
452461 */
453462 public function getErrors (){
454- return imap_errors ();
463+ $ this ->errors = array_merge ($ this ->errors , imap_errors () ?: []);
464+
465+ return $ this ->errors ;
455466 }
456467
457468 /**
You can’t perform that action at this time.
0 commit comments