Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5933418

Browse files
committed
~ fix for new TypeIdentifier
1 parent8449d56 commit5933418

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,18 @@ private function validateAndDenormalize(Type $type, string $currentClass, string
760760
}
761761
}
762762

763+
if (is_numeric($data) && XmlEncoder::FORMAT ===$format) {
764+
// encoder parsed them wrong, so they might need to be transformed back
765+
switch ($typeIdentifier) {
766+
case TypeIdentifier::STRING:
767+
return (string)$data;
768+
case TypeIdentifier::FLOAT:
769+
return (float)$data;
770+
case TypeIdentifier::INT:
771+
return (int)$data;
772+
}
773+
}
774+
763775
if ($collectionValueType) {
764776
try {
765777
$collectionValueBaseType =$collectionValueType;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp