don't change state in case of exception
This commit is contained in:
parent
6e7182f9e3
commit
dcd47335a8
@ -255,12 +255,12 @@ class ValidatorBuilder implements ValidatorBuilderInterface
|
||||
*/
|
||||
public function setMappingCache(CacheItemPoolInterface $cache)
|
||||
{
|
||||
$this->mappingCache = $cache;
|
||||
|
||||
if (null !== $this->metadataFactory) {
|
||||
throw new ValidatorException('You cannot set a custom mapping cache after setting a custom metadata factory. Configure your metadata factory instead.');
|
||||
}
|
||||
|
||||
$this->mappingCache = $cache;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user