8000 [Serializer] Improve performance of AbstractObjectDenormalizer with X… · symfony/symfony@06060ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 06060ff

Browse files
committed
[Serializer] Improve performance of AbstractObjectDenormalizer with XML/CSV
1 parent 0bd2935 commit 06060ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ private function validateAndDenormalize(array $types, string $currentClass, stri
451451
}
452452
break;
453453
case Type::BUILTIN_TYPE_INT:
454-
if (ctype_digit($data) || '-' === $data[0] && ctype_digit(substr($data, 1))) {
454+
if (ctype_digit('-' === $data[0] ? substr($data, 1) : $data)) {
455455
$data = (int) $data;
456456
} else {
457457
throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type of the "%s" attribute for class "%s" must be int ("%s" given).', $attribute, $currentClass, $data), $data, [Type::BUILTIN_TYPE_INT], $context['deserialization_path'] ?? null);

0 commit comments

Comments
 (0)
0