Skip to content

Commit e3ec068

Browse files
Merge branch '4.4' into 5.4
* 4.4: [Serializer] Fix passing null to str_contains() [DependencyInjection] Don't reset env placeholders during compilation [HttpClient] Fix overriding default options with null [DependencyInjection] Clarify that using expressions in parameters is not allowed [GHA] Cancel running CI jobs when a PR is updated [Validator] Improve tests for the Image and File constraints [Validator][Tests] Fix AssertingContextualValidator not throwing on remaining expectations
2 parents 45276e3 + 5a13555 commit e3ec068

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Normalizer/AbstractObjectNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ private function validateAndDenormalize(array $types, string $currentClass, stri
556556
// PHP's json_decode automatically converts Numbers without a decimal part to integers.
557557
// To circumvent this behavior, integers are converted to floats when denormalizing JSON based formats and when
558558
// a float is expected.
559-
if (Type::BUILTIN_TYPE_FLOAT === $builtinType && \is_int($data) && str_contains($format, JsonEncoder::FORMAT)) {
559+
if (Type::BUILTIN_TYPE_FLOAT === $builtinType && \is_int($data) && null !== $format && str_contains($format, JsonEncoder::FORMAT)) {
560560
return (float) $data;
561561
}
562562

0 commit comments

Comments
 (0)