Skip to content

Commit 5d94ace

Browse files
committed
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 ------- dcd4733 don't change state in case of exception
2 parents b07df9d + dcd4733 commit 5d94ace

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Validator/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)