without this change allways the legacy code get called

This commit is contained in:
Dominik Zogg 2015-06-06 08:40:52 +00:00 committed by Fabien Potencier
parent 75d5d547bb
commit 96a30bf31d

View File

@ -59,13 +59,13 @@ class ValidatorExtension extends AbstractExtension
public function loadTypeGuesser()
{
// 2.4 API
if ($this->validator instanceof LegacyValidatorInterface) {
return new ValidatorTypeGuesser($this->validator->getMetadataFactory());
// 2.5 API
if ($this->validator instanceof ValidatorInterface) {
return new ValidatorTypeGuesser($this->validator);
}
// 2.5 API - ValidatorInterface extends MetadataFactoryInterface
return new ValidatorTypeGuesser($this->validator);
// 2.4 API
return new ValidatorTypeGuesser($this->validator->getMetadataFactory());
}
protected function loadTypeExtensions()