mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 08:27:03 +03:00
Remove useless NewInstance
Bugfix: BodyStructure->SearchCharset return value
This commit is contained in:
parent
82e560bc53
commit
693e0f4c10
61 changed files with 802 additions and 1345 deletions
|
|
@ -50,7 +50,7 @@ class Folder
|
|||
/**
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
private function __construct(string $sFullNameRaw, string $sDelimiter, array $aFlags)
|
||||
function __construct(string $sFullNameRaw, string $sDelimiter = '.', array $aFlags = array())
|
||||
{
|
||||
$sDelimiter = 'NIL' === \strtoupper($sDelimiter) ? '' : $sDelimiter;
|
||||
if (empty($sDelimiter))
|
||||
|
|
@ -60,7 +60,7 @@ class Folder
|
|||
|
||||
if (1 < \strlen($sDelimiter) || 0 === \strlen($sFullNameRaw))
|
||||
{
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException;
|
||||
}
|
||||
|
||||
$this->sFullNameRaw = $sFullNameRaw;
|
||||
|
|
@ -82,21 +82,13 @@ class Folder
|
|||
$aNames = \explode($this->sDelimiter, $this->sFullNameRaw);
|
||||
if (false !== \array_search('', $aNames))
|
||||
{
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException;
|
||||
}
|
||||
|
||||
$this->sNameRaw = \end($aNames);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public static function NewInstance(string $sFullNameRaw, string $sDelimiter = '.', array $aFlags = array()) : self
|
||||
{
|
||||
return new self($sFullNameRaw, $sDelimiter, $aFlags);
|
||||
}
|
||||
|
||||
public function NameRaw() : string
|
||||
{
|
||||
return $this->sNameRaw;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue