This commit is contained in:
the-djmaze 2023-02-12 01:02:55 +01:00
parent 98d686bc14
commit 6237a3691b
3 changed files with 5 additions and 5 deletions

View file

@ -28,7 +28,7 @@ class Email implements \JsonSerializable
*/
function __construct(string $sEmail, string $sDisplayName = '')
{
if (!\strlen(\trim($sEmail))) {
if (!\strlen(\trim($sEmail)) && !\strlen(\trim($sDisplayName))) {
throw new \InvalidArgumentException;
}

View file

@ -81,7 +81,7 @@ class HeaderCollection extends \MailSo\Base\Collection
if (\strlen($sValue)) {
$oResult = new EmailCollection($sValue);
}
return $oResult && $oResult->count() ? $oResult : null;
return $oResult;
}
public function ParametersByName(string $sHeaderName) : ?ParameterCollection