bug #33568 [Validator] don't change state in case of exception (xabbuh)
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] don't change state in case of exception
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
dcd47335a8
don't change state in case of exception
This commit is contained in:
commit
5d94ace5ea
@ -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