4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator;
15 * Entry point for the Validator component.
17 * @author Bernhard Schussek <bschussek@gmail.com>
19 final class Validation
22 * The Validator API provided by Symfony 2.4 and older.
24 * @deprecated use API_VERSION_2_5_BC instead.
26 const API_VERSION_2_4 = 1;
29 * The Validator API provided by Symfony 2.5 and newer.
31 const API_VERSION_2_5 = 2;
34 * The Validator API provided by Symfony 2.5 and newer with a backwards
35 * compatibility layer for 2.4 and older.
37 const API_VERSION_2_5_BC = 3;
40 * Creates a new validator.
42 * If you want to configure the validator, use
43 * {@link createValidatorBuilder()} instead.
45 * @return ValidatorInterface The new validator
47 public static function createValidator()
49 return self::createValidatorBuilder()->getValidator();
53 * Creates a configurable builder for validator objects.
55 * @return ValidatorBuilderInterface The new builder
57 public static function createValidatorBuilder()
59 return new ValidatorBuilder();
63 * This class cannot be instantiated.
65 private function __construct()