mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Bugfixes and more conversions to PHP 7
This commit is contained in:
parent
2cada68f41
commit
3a7ec4ecb0
100 changed files with 238 additions and 992 deletions
|
|
@ -66,10 +66,8 @@ class Header
|
|||
* @param string $sName
|
||||
* @param string $sValue
|
||||
* @param string $sEncodedValueForReparse
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function initInputData($sName, $sValue, $sEncodedValueForReparse)
|
||||
private function initInputData($sName, $sValue, $sEncodedValueForReparse) : void
|
||||
{
|
||||
$this->sName = trim($sName);
|
||||
$this->sFullValue = trim($sValue);
|
||||
|
|
|
|||
|
|
@ -211,19 +211,6 @@ class HeaderCollection extends \MailSo\Base\Collection
|
|||
return $oResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aList
|
||||
* @return \MailSo\Mime\HeaderCollection
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function SetAsArray($aList)
|
||||
{
|
||||
parent::SetAsArray($aList);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sParentCharset
|
||||
* @return \MailSo\Mime\HeaderCollection
|
||||
|
|
@ -249,10 +236,7 @@ class HeaderCollection extends \MailSo\Base\Collection
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function Clear()
|
||||
public function Clear() : void
|
||||
{
|
||||
parent::Clear();
|
||||
|
||||
|
|
|
|||
|
|
@ -97,20 +97,16 @@ class Message
|
|||
|
||||
/**
|
||||
* @param string $sMessageId
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function SetMessageId($sMessageId)
|
||||
public function SetMessageId($sMessageId) : void
|
||||
{
|
||||
$this->aHeadersValue[\MailSo\Mime\Enumerations\Header::MESSAGE_ID] = $sMessageId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sHostName = ''
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function RegenerateMessageId($sHostName = '')
|
||||
public function RegenerateMessageId($sHostName = '') : void
|
||||
{
|
||||
$this->SetMessageId($this->generateNewMessageId($sHostName));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,20 +52,6 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
return $mResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aList
|
||||
*
|
||||
* @return \MailSo\Mime\ParameterCollection
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function SetAsArray($aList)
|
||||
{
|
||||
parent::SetAsArray($aList);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
*
|
||||
|
|
@ -131,10 +117,7 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
return 0 < \count($aResult) ? \implode('; ', $aResult) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function reParseParameters()
|
||||
private function reParseParameters() : void
|
||||
{
|
||||
$aDataToReParse = $this->CloneAsArray();
|
||||
$sCharset = \MailSo\Base\Enumerations\Charset::UTF_8;
|
||||
|
|
|
|||
|
|
@ -18,64 +18,31 @@ namespace MailSo\Mime\Parser;
|
|||
*/
|
||||
class ParserEmpty implements ParserInterface
|
||||
{
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oPart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function StartParse(\MailSo\Mime\Part &$oPart)
|
||||
public function StartParse(\MailSo\Mime\Part $oPart) : void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oPart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function EndParse(\MailSo\Mime\Part &$oPart)
|
||||
public function EndParse(\MailSo\Mime\Part $oPart) : void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oPart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function StartParseMimePart(\MailSo\Mime\Part &$oPart)
|
||||
public function StartParseMimePart(\MailSo\Mime\Part $oPart) : void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oMimePart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function EndParseMimePart(\MailSo\Mime\Part &$oPart)
|
||||
public function EndParseMimePart(\MailSo\Mime\Part $oPart) : void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function InitMimePartHeader()
|
||||
public function InitMimePartHeader() : void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sBuffer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function ReadBuffer($sBuffer)
|
||||
public function ReadBuffer(string $sBuffer) : void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sBuffer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function WriteBody($sBuffer)
|
||||
public function WriteBody(string $sBuffer) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,49 +18,17 @@ namespace MailSo\Mime\Parser;
|
|||
*/
|
||||
interface ParserInterface
|
||||
{
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oPart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function StartParse(\MailSo\Mime\Part &$oPart);
|
||||
public function StartParse(\MailSo\Mime\Part $oPart) : void;
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oPart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function EndParse(\MailSo\Mime\Part &$oPart);
|
||||
public function EndParse(\MailSo\Mime\Part $oPart) : void;
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oPart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function StartParseMimePart(\MailSo\Mime\Part &$oPart);
|
||||
public function StartParseMimePart(\MailSo\Mime\Part $oPart) : void;
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oMimePart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function EndParseMimePart(\MailSo\Mime\Part &$oPart);
|
||||
public function EndParseMimePart(\MailSo\Mime\Part $oPart) : void;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function InitMimePartHeader();
|
||||
public function InitMimePartHeader() : void;
|
||||
|
||||
/**
|
||||
* @param string $sBuffer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function ReadBuffer($sBuffer);
|
||||
public function ReadBuffer(string $sBuffer) : void;
|
||||
|
||||
/**
|
||||
* @param string $sBuffer
|
||||
* @return void
|
||||
*/
|
||||
public function WriteBody($sBuffer);
|
||||
public function WriteBody(string $sBuffer) : void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,22 +23,12 @@ class ParserMemory extends ParserEmpty implements ParserInterface
|
|||
*/
|
||||
protected $oCurrentMime = null;
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Part $oMimePart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function StartParseMimePart(\MailSo\Mime\Part &$oPart)
|
||||
public function StartParseMimePart(\MailSo\Mime\Part $oPart) : void
|
||||
{
|
||||
$this->oCurrentMime = $oPart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sBuffer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function WriteBody($sBuffer)
|
||||
public function WriteBody(string $sBuffer) : void
|
||||
{
|
||||
if (null === $this->oCurrentMime->Body)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue