Skip to content

[Serializer] Add an option to the XmlEncoder allowing to decode tags as collection #58604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: 7.4
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor(serializer): remove named parameter
  • Loading branch information
AlexandreGerault committed Oct 23, 2024
commit 517cd8748c8879ce28d83f3f7b9e1098d663199d
2 changes: 1 addition & 1 deletion src/Symfony/Component/Serializer/Encoder/XmlEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private function parseXml(\DOMNode $node, array $context = []): array|string
if (\is_array($value)
&& ($childNodeName = $node->firstChild?->nodeName)
&& 1 === \count($value)
&& \in_array($nodeName, $context[self::FORCE_COLLECTION] ?? [], strict: true)
&& \in_array($nodeName, $context[self::FORCE_COLLECTION] ?? [], true)
) {
return [$childNodeName => [$value[$childNodeName]]];
}
Expand Down