[Validator] Avoid triggering the autoloader for user-input values

This commit is contained in:
Jordi Boggiano 2021-03-18 08:44:57 +01:00 committed by Nicolas Grekas
parent 6a6274ca89
commit e45eb23ba2

View File

@ -656,8 +656,10 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
return; return;
} }
// If the value is a scalar, pass it anyway, because we want if (!\is_object($value)) {
// a NoSuchMetadataException to be thrown in that case throw new NoSuchMetadataException(sprintf('Cannot create metadata for non-objects. Got: "%s".', \gettype($value)));
}
$this->validateObject( $this->validateObject(
$value, $value,
$propertyPath, $propertyPath,