Loading core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php +1 −36 Original line number Diff line number Diff line Loading @@ -157,14 +157,7 @@ public function setConstraint(Constraint $constraint) { /** * {@inheritdoc} */ public function addViolation($message, array $parameters = [], $invalidValue = NULL, $plural = NULL, $code = NULL) { // The parameters $invalidValue and following are ignored by the new // API, as they are not present in the new interface anymore. // You should use buildViolation() instead. if (func_num_args() > 2) { throw new \LogicException('Legacy validator API is unsupported.'); } public function addViolation($message, array $parameters = []) { $this->violations->add(new ConstraintViolation($this->translator->trans($message, $parameters, $this->translationDomain), $message, $parameters, $this->root, $this->propertyPath, $this->value, NULL, NULL, $this->constraint)); } Loading Loading @@ -245,20 +238,6 @@ public function getPropertyPath($sub_path = ''): string { return PropertyPath::append($this->propertyPath, $sub_path); } /** * {@inheritdoc} */ public function addViolationAt($subPath, $message, array $parameters = [], $invalidValue = NULL, $plural = NULL, $code = NULL) { throw new \LogicException('Legacy validator API is unsupported.'); } /** * {@inheritdoc} */ public function validate($value, $subPath = '', $groups = NULL, $traverse = FALSE, $deep = FALSE) { throw new \LogicException('Legacy validator API is unsupported.'); } /** * {@inheritdoc} */ Loading @@ -273,13 +252,6 @@ public function isConstraintValidated($cache_key, $constraint_hash): bool { return isset($this->validatedConstraints[$cache_key . ':' . $constraint_hash]); } /** * {@inheritdoc} */ public function validateValue($value, $constraints, $subPath = '', $groups = NULL) { throw new \LogicException('Legacy validator API is unsupported.'); } /** * {@inheritdoc} */ Loading Loading @@ -308,11 +280,4 @@ public function isObjectInitialized($cache_key): bool { throw new \LogicException('\Symfony\Component\Validator\Context\ExecutionContextInterface::isObjectInitialized is unsupported.'); } /** * {@inheritdoc} */ public function getMetadataFactory() { throw new \LogicException('Legacy validator API is unsupported.'); } } Loading
core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php +1 −36 Original line number Diff line number Diff line Loading @@ -157,14 +157,7 @@ public function setConstraint(Constraint $constraint) { /** * {@inheritdoc} */ public function addViolation($message, array $parameters = [], $invalidValue = NULL, $plural = NULL, $code = NULL) { // The parameters $invalidValue and following are ignored by the new // API, as they are not present in the new interface anymore. // You should use buildViolation() instead. if (func_num_args() > 2) { throw new \LogicException('Legacy validator API is unsupported.'); } public function addViolation($message, array $parameters = []) { $this->violations->add(new ConstraintViolation($this->translator->trans($message, $parameters, $this->translationDomain), $message, $parameters, $this->root, $this->propertyPath, $this->value, NULL, NULL, $this->constraint)); } Loading Loading @@ -245,20 +238,6 @@ public function getPropertyPath($sub_path = ''): string { return PropertyPath::append($this->propertyPath, $sub_path); } /** * {@inheritdoc} */ public function addViolationAt($subPath, $message, array $parameters = [], $invalidValue = NULL, $plural = NULL, $code = NULL) { throw new \LogicException('Legacy validator API is unsupported.'); } /** * {@inheritdoc} */ public function validate($value, $subPath = '', $groups = NULL, $traverse = FALSE, $deep = FALSE) { throw new \LogicException('Legacy validator API is unsupported.'); } /** * {@inheritdoc} */ Loading @@ -273,13 +252,6 @@ public function isConstraintValidated($cache_key, $constraint_hash): bool { return isset($this->validatedConstraints[$cache_key . ':' . $constraint_hash]); } /** * {@inheritdoc} */ public function validateValue($value, $constraints, $subPath = '', $groups = NULL) { throw new \LogicException('Legacy validator API is unsupported.'); } /** * {@inheritdoc} */ Loading Loading @@ -308,11 +280,4 @@ public function isObjectInitialized($cache_key): bool { throw new \LogicException('\Symfony\Component\Validator\Context\ExecutionContextInterface::isObjectInitialized is unsupported.'); } /** * {@inheritdoc} */ public function getMetadataFactory() { throw new \LogicException('Legacy validator API is unsupported.'); } }