mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
cleanup MailSo a bit
This commit is contained in:
parent
31d6666729
commit
a197378b7c
4 changed files with 7 additions and 18 deletions
|
@ -25,13 +25,7 @@ class CacheClient
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sCacheIndex;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->oDriver = null;
|
||||
$this->sCacheIndex = '';
|
||||
}
|
||||
private $sCacheIndex = '';
|
||||
|
||||
public function Set(string $sKey, string $sValue) : bool
|
||||
{
|
||||
|
@ -111,7 +105,7 @@ class CacheClient
|
|||
|
||||
public function IsInited() : bool
|
||||
{
|
||||
return $this->oDriver instanceof DriverInterface;
|
||||
return !!$this->oDriver;
|
||||
}
|
||||
|
||||
public function SetCacheIndex(string $sCacheIndex) : self
|
||||
|
|
|
@ -49,7 +49,7 @@ class NamespaceResult
|
|||
|
||||
public function InitByImapResponse(\MailSo\Imap\Response $oImapResponse) : self
|
||||
{
|
||||
if ($oImapResponse && $oImapResponse instanceof \MailSo\Imap\Response)
|
||||
if ($oImapResponse)
|
||||
{
|
||||
if (isset($oImapResponse->ResponseList[2][0]) &&
|
||||
\is_array($oImapResponse->ResponseList[2][0]) &&
|
||||
|
|
|
@ -190,16 +190,16 @@ class Logger extends \SplFixedArray
|
|||
|
||||
public function WriteException(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
|
||||
{
|
||||
if (!isset($oException->__LOGINNED__)) {
|
||||
$oException->__LOGINNED__ = true;
|
||||
if (empty($oException->__WRITTEN__)) {
|
||||
$oException->__WRITTEN__ = true;
|
||||
$this->Write((string) $oException, $iType, $sName);
|
||||
}
|
||||
}
|
||||
|
||||
public function WriteExceptionShort(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
|
||||
{
|
||||
if (!isset($oException->__LOGINNED__)) {
|
||||
$oException->__LOGINNED__ = true;
|
||||
if (empty($oException->__WRITTEN__)) {
|
||||
$oException->__WRITTEN__ = true;
|
||||
$this->Write($oException->getMessage(), $iType, $sName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1299,11 +1299,6 @@ class MailClient
|
|||
*/
|
||||
public function SetLogger(\MailSo\Log\Logger $oLogger) : self
|
||||
{
|
||||
if (!($oLogger instanceof \MailSo\Log\Logger))
|
||||
{
|
||||
throw new \InvalidArgumentException;
|
||||
}
|
||||
|
||||
$this->oLogger = $oLogger;
|
||||
$this->oImapClient->SetLogger($this->oLogger);
|
||||
|
||||
|
|
Loading…
Reference in a new issue