mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47: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
|
|
@ -49,7 +49,7 @@ class Account
|
|||
*/
|
||||
private $sParentEmail;
|
||||
|
||||
protected function __construct(string $sEmail, string $sLogin, string $sPassword,
|
||||
function __construct(string $sEmail, string $sLogin, string $sPassword,
|
||||
\RainLoop\Model\Domain $oDomain, string $sSignMeToken = '', string $sProxyAuthUser = '',
|
||||
string $sProxyAuthPassword = '', string $sClientCert = '')
|
||||
{
|
||||
|
|
@ -64,13 +64,6 @@ class Account
|
|||
$this->sParentEmail = '';
|
||||
}
|
||||
|
||||
public static function NewInstance(string $sEmail, string $sLogin, string $sPassword,
|
||||
\RainLoop\Model\Domain $oDomain, string $sSignMeToken = '', string $sProxyAuthUser = '',
|
||||
string $sProxyAuthPassword = '', string $sClientCert = '') : self
|
||||
{
|
||||
return new self($sEmail, $sLogin, $sPassword, $oDomain, $sSignMeToken, $sProxyAuthUser, $sProxyAuthPassword, $sClientCert);
|
||||
}
|
||||
|
||||
public function Email() : string
|
||||
{
|
||||
return $this->sEmail;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class Domain
|
|||
*/
|
||||
private $sAliasName;
|
||||
|
||||
private function __construct(string $sName,
|
||||
function __construct(string $sName,
|
||||
string $sIncHost, int $iIncPort, int $iIncSecure, bool $bIncShortLogin,
|
||||
bool $bUseSieve, string $sSieveHost, int $iSievePort, int $iSieveSecure,
|
||||
string $sOutHost, int $iOutPort, int $iOutSecure, bool $bOutShortLogin,
|
||||
|
|
@ -128,19 +128,6 @@ class Domain
|
|||
$this->sAliasName = '';
|
||||
}
|
||||
|
||||
public static function NewInstance(string $sName,
|
||||
string $sIncHost, int $iIncPort, int $iIncSecure, bool $bIncShortLogin,
|
||||
bool $bUseSieve, string $sSieveHost, int $iSievePort, int $iSieveSecure,
|
||||
string $sOutHost, int $iOutPort, int $iOutSecure, bool $bOutShortLogin,
|
||||
bool $bOutAuth, bool $bOutUsePhpMail, string $sWhiteList = '') : self
|
||||
{
|
||||
return new self($sName,
|
||||
$sIncHost, $iIncPort, $iIncSecure, $bIncShortLogin,
|
||||
$bUseSieve, $sSieveHost, $iSievePort, $iSieveSecure,
|
||||
$sOutHost, $iOutPort, $iOutSecure, $bOutShortLogin, $bOutAuth, $bOutUsePhpMail,
|
||||
$sWhiteList);
|
||||
}
|
||||
|
||||
public static function NewInstanceFromDomainConfigArray(string $sName, array $aDomain) : ?\RainLoop\Model\Domain
|
||||
{
|
||||
$oDomain = null;
|
||||
|
|
@ -172,7 +159,7 @@ class Domain
|
|||
$bIncShortLogin = !empty($aDomain['imap_short_login']);
|
||||
$bOutShortLogin = !empty($aDomain['smtp_short_login']);
|
||||
|
||||
$oDomain = self::NewInstance($sName,
|
||||
$oDomain = new self($sName,
|
||||
$sIncHost, $iIncPort, $iIncSecure, $bIncShortLogin,
|
||||
$bUseSieve, $sSieveHost, $iSievePort, $iSieveSecure,
|
||||
$sOutHost, $iOutPort, $iOutSecure, $bOutShortLogin, $bOutAuth, $bOutUsePhpMail,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Identity
|
|||
*/
|
||||
private $bSignatureInsertBefore;
|
||||
|
||||
protected function __construct(string $sId = '', string $sEmail = '')
|
||||
function __construct(string $sId = '', string $sEmail = '')
|
||||
{
|
||||
$this->sId = empty($sId) ? '' : $sId;
|
||||
$this->sEmail = empty($sEmail) ? '' : $sEmail;
|
||||
|
|
@ -50,16 +50,6 @@ class Identity
|
|||
$this->bSignatureInsertBefore = false;
|
||||
}
|
||||
|
||||
public static function NewInstance() : self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
public static function NewInstanceFromAccount(\RainLoop\Model\Account $oAccount) : self
|
||||
{
|
||||
return new self('', $oAccount->Email());
|
||||
}
|
||||
|
||||
public function Id(bool $bFillOnEmpty = false) : string
|
||||
{
|
||||
return $bFillOnEmpty ? ('' === $this->sId ? '---' : $this->sId) : $this->sId;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Template
|
|||
*/
|
||||
private $bPopulateAlways;
|
||||
|
||||
protected function __construct(string $sId = '', string $sName = '', string $sBody = '')
|
||||
function __construct(string $sId = '', string $sName = '', string $sBody = '')
|
||||
{
|
||||
$this->sId = $sId;
|
||||
$this->sName = $sName;
|
||||
|
|
@ -32,11 +32,6 @@ class Template
|
|||
$this->bPopulateAlways = false;
|
||||
}
|
||||
|
||||
public static function NewInstance(string $sId = '', string $sName = '', string $sBody = '') : self
|
||||
{
|
||||
return new self($sId, $sName, $sBody);
|
||||
}
|
||||
|
||||
public function Id() : string
|
||||
{
|
||||
return $this->sId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue