Skip to content

Commit

Permalink
Merge pull request #7 from dmolineus/hotfix/relative-callables
Browse files Browse the repository at this point in the history
Do not use relative callables
  • Loading branch information
discordier authored Apr 17, 2024
2 parents 79feb82 + 774ed38 commit 5828a75
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Xml/XmlElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public function setAttributeNS($namespace, $qualifiedName, $value): void
$namespace === XliffFile::XLIFF_NS
&& $this->ownerDocument->isDefaultNamespace(XliffFile::XLIFF_NS)
) {
call_user_func_array(['parent', 'setAttribute'], array_slice(func_get_args(), 1));
parent::setAttribute($qualifiedName, $value);
return;
}

call_user_func_array(['parent', 'setAttributeNS'], func_get_args());
parent::setAttributeNS($namespace, $qualifiedName, $value);
}

/**
Expand All @@ -69,11 +69,9 @@ public function getAttributeNS($namespace, $localName): string
$namespace === XliffFile::XLIFF_NS
&& $this->ownerDocument->isDefaultNamespace(XliffFile::XLIFF_NS)
) {
/** @psalm-suppress MixedReturnStatement */
return call_user_func_array(['parent', 'getAttribute'], array_slice(func_get_args(), 1));
return parent::getAttribute($localName);
}

/** @psalm-suppress MixedReturnStatement */
return call_user_func_array(['parent', 'getAttributeNS'], func_get_args());
return parent::getAttributeNS($namespace, $localName);
}
}

0 comments on commit 5828a75

Please sign in to comment.