php-imap
php-imap copied to clipboard
Recursive handling of stdClass in response
For example, calling overview() on a folder using LegacyProcotol (i.e. POP3) can result in error Error: Object of class stdClass could not be converted to string in /path/to/code/webklex/php-imap/src/Connection/Protocols/Response.php:365, because response might contain stdClass object which is not yet handled recursively by verify_data().
Because stdClass is handled in a similar way like arrays in PHP, we can simply add check for $data instanceof stdClass to IF-clause in verify_data() and recursive processing is done by existing code then.