Issue #3231683 by daffie, longwave: [Symfony 6] A number of methods of the...
Issue #3231683 by daffie, longwave: [Symfony 6] A number of methods of the class Drupal\Core\TypedData\Validation\ExecutionContext are considered internal and Drupal should not override them
(cherry picked from commit b4a6273e)
@trigger_error(__CLASS__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the class \Symfony\Component\Validator\Violation\ConstraintViolationBuilder instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->violations=$violations;
$this->message=$message;
$this->parameters=$parameters;
@@ -134,9 +139,16 @@ public function __construct(ConstraintViolationList $violations, Constraint $con
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::atPath() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setParameter() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->parameters[$key]=$value;
return$this;
@@ -154,9 +173,16 @@ public function setParameter($key, $value)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setParameters() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->parameters=$parameters;
return$this;
@@ -164,9 +190,16 @@ public function setParameters(array $parameters)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setTranslationDomain() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->translationDomain=$translationDomain;
return$this;
@@ -174,9 +207,16 @@ public function setTranslationDomain($translationDomain)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setInvalidValue() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->invalidValue=$invalidValue;
return$this;
@@ -184,9 +224,16 @@ public function setInvalidValue($invalidValue)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setPlural() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->plural=$number;
return$this;
@@ -194,9 +241,16 @@ public function setPlural($number)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setCode() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->code=$code;
return$this;
@@ -204,9 +258,16 @@ public function setCode($code)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setCause() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->cause=$cause;
return$this;
@@ -214,9 +275,16 @@ public function setCause($cause)
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::addViolation() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__CLASS__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the class \Symfony\Component\Validator\Context\ExecutionContext instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->validator=$validator;
$this->root=$root;
$this->translator=$translator;
@@ -131,8 +137,15 @@ public function __construct(ValidatorInterface $validator, $root, TranslatorInte
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::setNode() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->value=$value;
$this->data=$object;
$this->metadata=$metadata;
@@ -141,22 +154,43 @@ public function setNode($value, $object, MetadataInterface $metadata = NULL, $pr
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::setGroup() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->group=$group;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::setConstraint() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
$this->constraint=$constraint;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::addViolation() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
// 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.
@@ -169,148 +203,295 @@ public function addViolation($message, array $parameters = [], $invalidValue = N
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::buildViolation() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getViolations() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->violations;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getValidator() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->validator;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getRoot() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->root;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getValue() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->value;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getObject() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->data;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getMetadata() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->metadata;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getGroup() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
returnConstraint::DEFAULT_GROUP;
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getClassName() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
returnget_class($this->data);
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getPropertyName() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
return$this->data->getName();
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getPropertyPath() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::addViolationAt() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
thrownew\LogicException('Legacy validator API is unsupported.');
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::validate() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
thrownew\LogicException('Legacy validator API is unsupported.');
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::markConstraintAsValidated() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::isConstraintValidated() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::validateValue() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
thrownew\LogicException('Legacy validator API is unsupported.');
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::markGroupAsValidated() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::isGroupValidated() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::markObjectAsInitialized() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
// Not supported, so nothing todo.
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::isObjectInitialized() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
// Not supported, so nothing todo.
}
/**
* {@inheritdoc}
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
@trigger_error(__METHOD__.' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Context\ExecutionContext::getMetadataFactory() instead. See https://www.drupal.org/node/3238432',E_USER_DEPRECATED);
thrownew\LogicException('Legacy validator API is unsupported.');