Skip to content

Commit d99c3a8

Browse files
committed
Return early
1 parent 56ac1a7 commit d99c3a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Serializer/AbstractItemNormalizer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,12 @@ private function createAttributeValue($attribute, $value, $format = null, array
336336
return $this->denormalizeRelation($attribute, $propertyMetadata, $className, $value, $format, $this->createChildContext($context, $attribute));
337337
}
338338

339-
if (empty($context[static::DISABLE_TYPE_ENFORCEMENT])) {
340-
$this->validateType($attribute, $type, $value, $format);
339+
if ($context[static::DISABLE_TYPE_ENFORCEMENT] ?? false) {
340+
return $value;
341341
}
342342

343+
$this->validateType($attribute, $type, $value, $format);
344+
343345
return $value;
344346
}
345347

0 commit comments

Comments
 (0)