[PHP-Symfony] fix #15950: Add float to deserialize (#16835)

* [PHP-Symfony] fix #15950: Add float to deserialize

* Add test sample

* Add double

---------

Co-authored-by: DaxServer <daxserver@icloud.com>
This commit is contained in:
DaxServer
2023-10-16 16:19:33 +02:00
committed by GitHub
parent b6db4f73f1
commit 8bb473316e
2 changed files with 14 additions and 0 deletions

View File

@@ -75,6 +75,13 @@ class JmsSerializer implements SerializerInterface
return $data + 0;
}
break;
case 'double':
case 'float':
if (is_float($data) || is_numeric($data)) {
return (float) $data;
}
break;
case 'string':
break;