Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  [Lock] Release Locks from Internal Store on Postgres waitAndSave*
  [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
  • Loading branch information
nicolas-grekas committed Feb 24, 2022
2 parents 6043dea + e3ec068 commit c26ce23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Normalizer/AbstractObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ private function validateAndDenormalize(array $types, string $currentClass, stri
// PHP's json_decode automatically converts Numbers without a decimal part to integers.
// To circumvent this behavior, integers are converted to floats when denormalizing JSON based formats and when
// a float is expected.
if (Type::BUILTIN_TYPE_FLOAT === $builtinType && \is_int($data) && str_contains($format, JsonEncoder::FORMAT)) {
if (Type::BUILTIN_TYPE_FLOAT === $builtinType && \is_int($data) && null !== $format && str_contains($format, JsonEncoder::FORMAT)) {
return (float) $data;
}

Expand Down

0 comments on commit c26ce23

Please sign in to comment.