Skip to content

Commit 9ae314e

Browse files
committed
don't change state in case of exception
1 parent 8fb6be4 commit 9ae314e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ValidatorBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ public function setMetadataCache(CacheInterface $cache)
255255
*/
256256
public function setMappingCache(CacheItemPoolInterface $cache)
257257
{
258-
$this->mappingCache = $cache;
259-
260258
if (null !== $this->metadataFactory) {
261259
throw new ValidatorException('You cannot set a custom mapping cache after setting a custom metadata factory. Configure your metadata factory instead.');
262260
}
263261

262+
$this->mappingCache = $cache;
263+
264264
return $this;
265265
}
266266

0 commit comments

Comments
 (0)