comparison vendor/symfony/validator/Constraints/Luhn.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Validator\Constraints;
13
14 use Symfony\Component\Validator\Constraint;
15
16 /**
17 * Metadata for the LuhnValidator.
18 *
19 * @Annotation
20 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
21 *
22 * @author Tim Nagel <t.nagel@infinite.net.au>
23 * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/
24 * @author Bernhard Schussek <bschussek@gmail.com>
25 */
26 class Luhn extends Constraint
27 {
28 const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e';
29 const CHECKSUM_FAILED_ERROR = '4d760774-3f50-4cd5-a6d5-b10a3299d8d3';
30
31 protected static $errorNames = array(
32 self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR',
33 self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR',
34 );
35
36 public $message = 'Invalid card number.';
37 }