Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Validator\Constraints; Chris@0: Chris@0: use Symfony\Component\Validator\Constraint; Chris@0: Chris@0: /** Chris@0: * Metadata for the LuhnValidator. Chris@0: * Chris@0: * @Annotation Chris@0: * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) Chris@0: * Chris@0: * @author Tim Nagel Chris@0: * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ Chris@0: * @author Bernhard Schussek Chris@0: */ Chris@0: class Luhn extends Constraint Chris@0: { Chris@0: const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; Chris@0: const CHECKSUM_FAILED_ERROR = '4d760774-3f50-4cd5-a6d5-b10a3299d8d3'; Chris@0: Chris@17: protected static $errorNames = [ Chris@0: self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', Chris@0: self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', Chris@17: ]; Chris@0: Chris@0: public $message = 'Invalid card number.'; Chris@0: }