CardScheme.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\Constraints;
  11. use Symfony\Component\Validator\Constraint;
  12. /**
  13. * Metadata for the CardSchemeValidator.
  14. *
  15. * @Annotation
  16. * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
  17. *
  18. * @author Tim Nagel <t.nagel@infinite.net.au>
  19. * @author Bernhard Schussek <bschussek@gmail.com>
  20. */
  21. class CardScheme extends Constraint
  22. {
  23. const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e';
  24. const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed';
  25. protected static $errorNames = array(
  26. self::NOT_NUMERIC_ERROR => 'NOT_NUMERIC_ERROR',
  27. self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR',
  28. );
  29. public $message = 'Unsupported card type or invalid card number.';
  30. public $schemes;
  31. public function getDefaultOption()
  32. {
  33. return 'schemes';
  34. }
  35. public function getRequiredOptions()
  36. {
  37. return array('schemes');
  38. }
  39. }