Skip to content

Commit

Permalink
Add language attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ben221199 committed Aug 28, 2024
1 parent 97fde01 commit 40a8bab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/EPPElementHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 40a8bab

Please sign in to comment.