IMAP oLastResponse not needed

This commit is contained in:
djmaze 2021-10-28 10:42:33 +02:00
parent 6c84313c98
commit 371797cab1
2 changed files with 3 additions and 19 deletions

View file

@ -39,9 +39,6 @@ class ResponseException extends \MailSo\Imap\Exceptions\Exception
public function GetLastResponse() : ?\MailSo\Imap\Response
{
if ($this->oResponses && \count($this->oResponses)) {
return $this->oResponses[count($this->oResponses) - 1];
}
return null;
return $this->oResponses ? $this->oResponses->getLast() : null;
}
}

View file

@ -39,11 +39,6 @@ class ImapClient extends \MailSo\Net\NetClient
*/
private $oCurrentFolderInfo = null;
/**
* @var ResponseCollection
*/
private $oLastResponse;
/**
* @var array
*/
@ -76,7 +71,6 @@ class ImapClient extends \MailSo\Net\NetClient
function __construct()
{
$this->oLastResponse = new ResponseCollection;
\ini_set('xdebug.max_nesting_level', 500);
}
@ -989,11 +983,11 @@ class ImapClient extends \MailSo\Net\NetClient
\MailSo\Base\Utils::MultipleStreamWriter($rMessageAppendStream, array($this->ConnectionResource()));
$this->sendRaw('');
$this->getResponse();
$oResponse = $this->getResponse();
if (null !== $iUid)
{
$oLast = $this->GetLastResponse()->getLast();
$oLast = $oResponse->getLast();
if ($oLast && Enumerations\ResponseType::TAGGED === $oLast->ResponseType && \is_array($oLast->OptionalResponse))
{
if (\strlen($oLast->OptionalResponse[0]) &&
@ -1099,11 +1093,6 @@ class ImapClient extends \MailSo\Net\NetClient
\MailSo\Log\Enumerations\Type::NOTICE, true);
}
public function GetLastResponse() : ResponseCollection
{
return $this->oLastResponse;
}
/**
* @throws \MailSo\Imap\Exceptions\ResponseNotFoundException
* @throws \MailSo\Imap\Exceptions\InvalidResponseException
@ -1140,8 +1129,6 @@ class ImapClient extends \MailSo\Net\NetClient
}
}
$this->oLastResponse = $oResult;
$oResult->validate();
} catch (\Throwable $e) {