cleanup MailSo a bit

This commit is contained in:
the-djmaze 2022-10-25 11:33:12 +02:00
parent 31d6666729
commit a197378b7c
4 changed files with 7 additions and 18 deletions

View file

@ -25,13 +25,7 @@ class CacheClient
/** /**
* @var string * @var string
*/ */
private $sCacheIndex; private $sCacheIndex = '';
function __construct()
{
$this->oDriver = null;
$this->sCacheIndex = '';
}
public function Set(string $sKey, string $sValue) : bool public function Set(string $sKey, string $sValue) : bool
{ {
@ -111,7 +105,7 @@ class CacheClient
public function IsInited() : bool public function IsInited() : bool
{ {
return $this->oDriver instanceof DriverInterface; return !!$this->oDriver;
} }
public function SetCacheIndex(string $sCacheIndex) : self public function SetCacheIndex(string $sCacheIndex) : self

View file

@ -49,7 +49,7 @@ class NamespaceResult
public function InitByImapResponse(\MailSo\Imap\Response $oImapResponse) : self public function InitByImapResponse(\MailSo\Imap\Response $oImapResponse) : self
{ {
if ($oImapResponse && $oImapResponse instanceof \MailSo\Imap\Response) if ($oImapResponse)
{ {
if (isset($oImapResponse->ResponseList[2][0]) && if (isset($oImapResponse->ResponseList[2][0]) &&
\is_array($oImapResponse->ResponseList[2][0]) && \is_array($oImapResponse->ResponseList[2][0]) &&

View file

@ -190,16 +190,16 @@ class Logger extends \SplFixedArray
public function WriteException(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void public function WriteException(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
{ {
if (!isset($oException->__LOGINNED__)) { if (empty($oException->__WRITTEN__)) {
$oException->__LOGINNED__ = true; $oException->__WRITTEN__ = true;
$this->Write((string) $oException, $iType, $sName); $this->Write((string) $oException, $iType, $sName);
} }
} }
public function WriteExceptionShort(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void public function WriteExceptionShort(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
{ {
if (!isset($oException->__LOGINNED__)) { if (empty($oException->__WRITTEN__)) {
$oException->__LOGINNED__ = true; $oException->__WRITTEN__ = true;
$this->Write($oException->getMessage(), $iType, $sName); $this->Write($oException->getMessage(), $iType, $sName);
} }
} }

View file

@ -1299,11 +1299,6 @@ class MailClient
*/ */
public function SetLogger(\MailSo\Log\Logger $oLogger) : self public function SetLogger(\MailSo\Log\Logger $oLogger) : self
{ {
if (!($oLogger instanceof \MailSo\Log\Logger))
{
throw new \InvalidArgumentException;
}
$this->oLogger = $oLogger; $this->oLogger = $oLogger;
$this->oImapClient->SetLogger($this->oLogger); $this->oImapClient->SetLogger($this->oLogger);