Validation.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Validator;
  11. /**
  12. * Entry point for the Validator component.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. final class Validation
  17. {
  18. /**
  19. * Creates a new validator.
  20. *
  21. * If you want to configure the validator, use
  22. * {@link createValidatorBuilder()} instead.
  23. *
  24. * @return ValidatorInterface The new validator.
  25. */
  26. public static function createValidator()
  27. {
  28. return self::createValidatorBuilder()->getValidator();
  29. }
  30. /**
  31. * Creates a configurable builder for validator objects.
  32. *
  33. * @return ValidatorBuilderInterface The new builder.
  34. */
  35. public static function createValidatorBuilder()
  36. {
  37. return new ValidatorBuilder();
  38. }
  39. /**
  40. * This class cannot be instantiated.
  41. */
  42. private function __construct()
  43. {
  44. }
  45. }