Skip to content

Commit f22c53c

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: fix PHP 7.2 compatibility
2 parents 20d5691 + 1e2dfe6 commit f22c53c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Validator/RecursiveContextualValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,13 @@ public function validatePropertyValue($objectOrClass, $propertyName, $value, $gr
261261

262262
if (is_object($objectOrClass)) {
263263
$object = $objectOrClass;
264+
$class = get_class($object);
264265
$cacheKey = spl_object_hash($objectOrClass);
265266
$propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName);
266267
} else {
267268
// $objectOrClass contains a class name
268269
$object = null;
270+
$class = $objectOrClass;
269271
$cacheKey = null;
270272
$propertyPath = $this->defaultPropertyPath;
271273
}
@@ -280,7 +282,7 @@ public function validatePropertyValue($objectOrClass, $propertyName, $value, $gr
280282
$this->validateGenericNode(
281283
$value,
282284
$object,
283-
$cacheKey.':'.get_class($object).':'.$propertyName,
285+
$cacheKey.':'.$class.':'.$propertyName,
284286
$propertyMetadata,
285287
$propertyPath,
286288
$groups,

0 commit comments

Comments
 (0)