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 CardSchemeValidator. Chris@0: * Chris@0: * @Annotation Chris@0: * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) Chris@0: * Chris@0: * @author Tim Nagel Chris@0: * @author Bernhard Schussek Chris@0: */ Chris@0: class CardScheme extends Constraint Chris@0: { Chris@0: const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e'; Chris@0: const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed'; Chris@0: Chris@17: protected static $errorNames = [ Chris@0: self::NOT_NUMERIC_ERROR => 'NOT_NUMERIC_ERROR', Chris@0: self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', Chris@17: ]; Chris@0: Chris@0: public $message = 'Unsupported card type or invalid card number.'; Chris@0: public $schemes; Chris@0: Chris@0: public function getDefaultOption() Chris@0: { Chris@0: return 'schemes'; Chris@0: } Chris@0: Chris@0: public function getRequiredOptions() Chris@0: { Chris@17: return ['schemes']; Chris@0: } Chris@0: }