Skip to content

Commit c37ccd5

Browse files
author
Maximilian Ruta
committed
[Serializer] Add CDATA_WRAPPING_NAME_PATTERN support to XmlEncoder
1 parent 7477348 commit c37ccd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Serializer/Encoder/XmlEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ private function appendNode(\DOMNode $parentNode, mixed $data, string $format, a
443443
/**
444444
* Checks if a value contains any characters which would require CDATA wrapping.
445445
*
446-
* @param array<mixed, mixed> $context
446+
* @param array<string, mixed> $context
447447
*/
448448
private function needsCdataWrapping(string $name, string $val, array $context): bool
449449
{

src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public function testCDataNamePattern()
581581
]];
582582

583583
$this->assertEquals($expected, $this->encoder->encode($source, 'xml',[
584-
XmlEncoder::CDATA_WRAPPING_NAME_PATTERN => '(firstname|lastname|)'
584+
XmlEncoder::CDATA_WRAPPING_NAME_PATTERN => '/(firstname|lastname)/'
585585
]));
586586
}
587587

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy