Remove useless NewInstance

Bugfix: BodyStructure->SearchCharset return value
This commit is contained in:
djmaze 2020-05-08 11:49:18 +02:00
parent 82e560bc53
commit 693e0f4c10
61 changed files with 802 additions and 1345 deletions

View file

@ -50,7 +50,7 @@ class Folder
/**
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
private function __construct(\MailSo\Imap\Folder $oImapFolder, bool $bSubscribed = true, bool $bExisten = true)
function __construct(\MailSo\Imap\Folder $oImapFolder, bool $bSubscribed = true, bool $bExisten = true)
{
$this->oImapFolder = $oImapFolder;
$this->oSubFolders = null;
@ -69,22 +69,14 @@ class Folder
$this->bExisten = $bExisten;
}
/**
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public static function NewInstance(\MailSo\Imap\Folder $oImapFolder, bool $bSubscribed = true, bool $bExisten = true) : self
{
return new self($oImapFolder, $bSubscribed, $bExisten);
}
/**
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
*/
public static function NewNonExistenInstance(string $sFullNameRaw, string $sDelimiter) : self
{
return self::NewInstance(
\MailSo\Imap\Folder::NewInstance($sFullNameRaw, $sDelimiter, array('\NoSelect')), true, false);
return new self(
new \MailSo\Imap\Folder($sFullNameRaw, $sDelimiter, array('\NoSelect')), true, false);
}
public function Name() : string
@ -142,7 +134,7 @@ class Folder
{
if ($bCreateIfNull && !$this->oSubFolders)
{
$this->oSubFolders = FolderCollection::NewInstance();
$this->oSubFolders = new FolderCollection;
}
return $this->oSubFolders;