@@ -71,6 +71,18 @@ class ErrorElement
return $this;
}
+ /**
+ * @param Constraint $constraint
+ *
+ * @return ErrorElement
+ */
+ public function addConstraint(Constraint $constraint)
+ {
+ $this->validate($constraint);
+
+ return $this;
+ }
/**
* @param string $name
* @param bool $key