You are here

public function ValidatorBuilder::setApiVersion in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/ValidatorBuilder.php \Symfony\Component\Validator\ValidatorBuilder::setApiVersion()

Overrides ValidatorBuilderInterface::setApiVersion

Deprecated

since version 2.7, to be removed in 3.0.

File

vendor/symfony/validator/ValidatorBuilder.php, line 319

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

public function setApiVersion($apiVersion) {
  @trigger_error('The ' . __METHOD__ . ' method is deprecated in version 2.7 and will be removed in version 3.0.', E_USER_DEPRECATED);
  if (!in_array($apiVersion, array(
    Validation::API_VERSION_2_4,
    Validation::API_VERSION_2_5,
    Validation::API_VERSION_2_5_BC,
  ))) {
    throw new InvalidArgumentException(sprintf('The requested API version is invalid: "%s"', $apiVersion));
  }
  return $this;
}