From 40a8bab5e35b34b5c2988f70dd016c4c61ff108e Mon Sep 17 00:00:00 2001 From: Ben van Hartingsveldt Date: Wed, 28 Aug 2024 13:16:35 +0200 Subject: [PATCH] Add language attribute --- src/EPPElementHelper.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/EPPElementHelper.php b/src/EPPElementHelper.php index 5194055..4142841 100644 --- a/src/EPPElementHelper.php +++ b/src/EPPElementHelper.php @@ -33,13 +33,16 @@ public static function createEPPResultElement(Document $document,string $code,EP /** * @param Document $document - * @param string $lang - * @param string|Node $content + * @param ?string|null $lang + * @param mixed ...$content * @return EPPMessageElement */ - public static function createEPPMessageElement(Document $document,string $lang,... $content): EPPMessageElement{ + public static function createEPPMessageElement(Document $document,?string $lang,... $content): EPPMessageElement{ /**@var EPPMessageElement $messageElement*/ $messageElement = $document->createElementNS(EPPNamespaces::EPP_1_0,'msg'); + if($lang){ + $messageElement->setAttribute('lang',$lang); + } if(is_string($content[0] ?? null)){ $messageElement->textContent = $content; }else{