From fbe83e8ccc34f09b13daf8a9069d39d929ad19c8 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca Date: Mon, 7 Oct 2024 17:57:26 +0200 Subject: [PATCH] fix(mentions): change/remove typings in unparser --- extensions/mentions/src/Formatter/UnparsePostMentions.php | 6 ++++-- extensions/mentions/src/Formatter/UnparseTagMentions.php | 6 ++++-- extensions/mentions/src/Formatter/UnparseUserMentions.php | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/extensions/mentions/src/Formatter/UnparsePostMentions.php b/extensions/mentions/src/Formatter/UnparsePostMentions.php index f223dd638f..12032ee813 100644 --- a/extensions/mentions/src/Formatter/UnparsePostMentions.php +++ b/extensions/mentions/src/Formatter/UnparsePostMentions.php @@ -30,10 +30,12 @@ public function __construct(TranslatorInterface $translator) * * @param string $xml * @param mixed $context - * @return string $xml to be unparsed + * @return mixed $xml to be unparsed */ - public function __invoke($context, string $xml) + public function __invoke($context, $xml) { + if ($xml === null) return $xml; + $xml = $this->updatePostMentionTags($context, $xml); $xml = $this->unparsePostMentionTags($xml); diff --git a/extensions/mentions/src/Formatter/UnparseTagMentions.php b/extensions/mentions/src/Formatter/UnparseTagMentions.php index b2cae82f2f..15da93d649 100644 --- a/extensions/mentions/src/Formatter/UnparseTagMentions.php +++ b/extensions/mentions/src/Formatter/UnparseTagMentions.php @@ -20,10 +20,12 @@ class UnparseTagMentions * * @param string $xml * @param mixed $context - * @return string $xml to be unparsed + * @return mixed $xml to be unparsed */ - public function __invoke($context, string $xml) + public function __invoke($context, $xml) { + if ($xml === null) return $xml; + $xml = $this->updateTagMentionTags($context, $xml); $xml = $this->unparseTagMentionTags($xml); diff --git a/extensions/mentions/src/Formatter/UnparseUserMentions.php b/extensions/mentions/src/Formatter/UnparseUserMentions.php index b150d2f7ba..943f1df432 100644 --- a/extensions/mentions/src/Formatter/UnparseUserMentions.php +++ b/extensions/mentions/src/Formatter/UnparseUserMentions.php @@ -31,10 +31,12 @@ public function __construct(TranslatorInterface $translator) * * @param string $xml * @param mixed $context - * @return string $xml to be unparsed + * @return mixed $xml to be unparsed */ - public function __invoke($context, string $xml) + public function __invoke($context, $xml) { + if ($xml === null) return $xml; + $xml = $this->updateUserMentionTags($context, $xml); $xml = $this->unparseUserMentionTags($xml);