Refactor IMAP class for type safety and logging#293
Open
kaellego wants to merge 1 commit intonextcloud:masterfrom
Open
Refactor IMAP class for type safety and logging#293kaellego wants to merge 1 commit intonextcloud:masterfrom
kaellego wants to merge 1 commit intonextcloud:masterfrom
Conversation
Refactor IMAP class properties and constructor for type safety. Update error handling and logging for IMAP authentication. Signed-off-by: Wellington Moraes <guiton.acre@gmail.com>
miaulalala
requested changes
Apr 15, 2026
Comment on lines
+51
to
+56
| private function logger(): ILogger { | ||
| /** @var ILogger $logger */ | ||
| $logger = \OC::$server->get(ILogger::class); | ||
| return $logger; | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
Not needed - $this->logger is a property of the parent class and injected via DI
Suggested change
| private function logger(): ILogger { | |
| /** @var ILogger $logger */ | |
| $logger = \OC::$server->get(ILogger::class); | |
| return $logger; | |
| } |
Comment on lines
+85
to
+86
| $this->logger()->error( | ||
| 'User has a wrong domain. Expected: ' . $this->domain, |
Collaborator
There was a problem hiding this comment.
Suggested change
| $this->logger()->error( | |
| 'User has a wrong domain. Expected: ' . $this->domain, | |
| $this->logger->error( | |
| 'User has a wrong domain. Expected: ' . $this->domain, |
|
|
||
| $ch = curl_init(); | ||
| if ($ch === false) { | ||
| $this->logger()->error( |
Collaborator
There was a problem hiding this comment.
Suggested change
| $this->logger()->error( | |
| $this->logger->error( |
| $errorcode === CURLE_SSL_CONNECT_ERROR || | ||
| $errorcode === CURLE_OPERATION_TIMEDOUT | ||
| ) { | ||
| $this->logger()->error( |
Collaborator
There was a problem hiding this comment.
Suggested change
| $this->logger()->error( | |
| $this->logger->error( |
| $errorcode === CURLE_LOGIN_DENIED || | ||
| (defined('CURLE_AUTH_ERROR') && $errorcode === CURLE_AUTH_ERROR) | ||
| ) { | ||
| $this->logger()->warning( |
Collaborator
There was a problem hiding this comment.
Suggested change
| $this->logger()->warning( | |
| $this->logger->warning( |
| } else { | ||
| $this->logger->error( | ||
| 'ERROR: IMAP server returned an error: ' . $errorcode . ' / ' . curl_strerror($errorcode), | ||
| $this->logger()->error( |
Collaborator
There was a problem hiding this comment.
Suggested change
| $this->logger()->error( | |
| $this->logger->error( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor IMAP class properties and constructor for type safety. Update error handling and logging for IMAP authentication.
Fixes #
Changes proposed in this pull request: