Cleanup & Speedup *Collection objects

This commit is contained in:
djmaze 2020-03-19 15:21:00 +01:00
parent f6fdb69c65
commit ebfde6e360
12 changed files with 169 additions and 209 deletions

View file

@ -32,11 +32,16 @@ class ParameterCollection extends \MailSo\Base\Collection
return new self($sRawParams);
}
public function append(Parameter $oHeader, bool $bToTop = false) : void
{
parent::append($oHeader, $bToTop);
}
public function ParameterValueByName(string $sName) : string
{
$sName = \strtolower(\trim($sName));
foreach ($this as /* @var $oParam \MailSo\Mime\ParameterCollection */ $oParam)
foreach ($this as $oParam)
{
if ($sName === \strtolower($oParam->Name()))
{
@ -66,7 +71,7 @@ class ParameterCollection extends \MailSo\Base\Collection
public function ToString(bool $bConvertSpecialsName = false) : string
{
$aResult = array();
foreach ($this as /* @var $oParam \MailSo\Mime\Parameter */ $oParam)
foreach ($this as $oParam)
{
$sLine = $oParam->ToString($bConvertSpecialsName);
if (0 < \strlen($sLine))
@ -86,7 +91,7 @@ class ParameterCollection extends \MailSo\Base\Collection
$this->Clear();
$aPreParams = array();
foreach ($aDataToReParse as /* @var $oParam \MailSo\Mime\Parameter */ $oParam)
foreach ($aDataToReParse as $oParam)
{
$aMatch = array();
$sParamName = $oParam->Name();