Fixed exception wording

This commit is contained in:
Valentin 2019-01-11 17:00:45 +03:00
parent a5c52b81f2
commit 8266262c9c

View File

@ -28,7 +28,7 @@ class ContainerConstraintValidatorFactory implements ConstraintValidatorFactoryI
public function __construct(ContainerInterface $container) public function __construct(ContainerInterface $container)
{ {
$this->container = $container; $this->container = $container;
$this->validators = array(); $this->validators = [];
} }
/** /**
@ -46,7 +46,7 @@ class ContainerConstraintValidatorFactory implements ConstraintValidatorFactoryI
$this->validators[$name] = $this->container->get($name); $this->validators[$name] = $this->container->get($name);
} else { } else {
if (!class_exists($name)) { if (!class_exists($name)) {
throw new ValidatorException(sprintf('Constraint validator "%s" does not exist or it is not enabled. Check the "validatedBy" method in your constraint class "%s".', $name, \get_class($constraint))); throw new ValidatorException(sprintf('Constraint validator "%s" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "%s".', $name, \get_class($constraint)));
} }
$this->validators[$name] = new $name(); $this->validators[$name] = new $name();