Commit 724c5521 authored by catch's avatar catch
Browse files

Issue #3258407 by longwave: Remove unused Symfony 2.x methods from ExecutionContext

parent 48e05492
Loading
Loading
Loading
Loading
+1 −36
Original line number Diff line number Diff line
@@ -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));
  }

@@ -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}
   */
@@ -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}
   */
@@ -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.');
  }

}