Commit fa15389b authored by alexkappa's avatar alexkappa

Separating validator service names and instances

parent 0c3234d2
...@@ -50,11 +50,11 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface ...@@ -50,11 +50,11 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
$name = $constraint->validatedBy(); $name = $constraint->validatedBy();
if (!isset($this->validators[$name])) { if (!isset($this->validators[$name])) {
$this->validators[$name] = new $name(); $validator = new $name();
} elseif (is_string($this->validators[$name])) { } elseif (is_string($this->validators[$name])) {
$this->validators[$name] = $this->container[$this->validators[$name]]; $validator = $this->container[$this->validators[$name]];
} }
return $this->validators[$name]; return $validator;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment