10000 Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant · symfony/symfony@001d0f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 001d0f1

Browse files
committed
Remove XmlEncoder::TYPE_CASE_ATTRIBUTES constant
1 parent 5e48c39 commit 001d0f1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Symfony/Component/Serializer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CHANGELOG
1717
* removed `XmlEncoder::setRootNodeName()` & `XmlEncoder::getRootNodeName()`, use the default context instead.
1818
* removed individual encoders/normalizers options as constructor arguments.
1919
* removed support for instantiating a `DataUriNormalizer` with a default MIME type guesser when the `symfony/mime` component isn't installed.
20+
* removed the `XmlEncoder::TYPE_CASE_ATTRIBUTES` constant. Use `XmlEncoder::TYPE_CAST_ATTRIBUTES` instead.
2021

2122
4.3.0
2223
-----

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class XmlEncoder implements EncoderInterface, DecoderInterface, NormalizationAwa
5151
const REMOVE_EMPTY_TAGS = 'remove_empty_tags';
5252
const ROOT_NODE_NAME = 'xml_root_node_name';
5353
const STANDALONE = 'xml_standalone';
54-
const TYPE_CASE_ATTRIBUTES = 'xml_type_cast_attributes';
54+
const TYPE_CAST_ATTRIBUTES = 'xml_type_cast_attributes';
5555
const VERSION = 'xml_version';
5656

5757
private $defaultContext = [
@@ -61,7 +61,7 @@ class XmlEncoder implements EncoderInterface, DecoderInterface, NormalizationAwa
6161
self::LOAD_OPTIONS => LIBXML_NONET | LIBXML_NOBLANKS,
6262
self::REMOVE_EMPTY_TAGS => false,
6363
self::ROOT_NODE_NAME => 'response',
64-
self::TYPE_CASE_ATTRIBUTES => true,
64+
self::TYPE_CAST_ATTRIBUTES => true,
6565
];
6666

6767
/**
@@ -293,7 +293,7 @@ private function parseXmlAttributes(\DOMNode $node, array $context = []): array
293293
}
294294

295295
$data = [];
296-
$typeCastAttributes = (bool) ($context[self::TYPE_CASE_ATTRIBUTES] ?? $this->defaultContext[self::TYPE_CASE_ATTRIBUTES]);
296+
$typeCastAttributes = (bool) ($context[self::TYPE_CAST_ATTRIBUTES] ?? $this->defaultContext[self::TYPE_CAST_ATTRIBUTES]);
297297

298298
foreach ($node->attributes as $attr) {
299299
if (!is_numeric($attr->nodeValue) || !$typeCastAttributes || (isset($attr->nodeValue[1]) && '0' === $attr->nodeValue[0])) {

0 commit comments

Comments
 (0)
0