annotate vendor/symfony/validator/Constraints/Choice.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /*
Chris@0 4 * This file is part of the Symfony package.
Chris@0 5 *
Chris@0 6 * (c) Fabien Potencier <fabien@symfony.com>
Chris@0 7 *
Chris@0 8 * For the full copyright and license information, please view the LICENSE
Chris@0 9 * file that was distributed with this source code.
Chris@0 10 */
Chris@0 11
Chris@0 12 namespace Symfony\Component\Validator\Constraints;
Chris@0 13
Chris@0 14 use Symfony\Component\Validator\Constraint;
Chris@0 15
Chris@0 16 /**
Chris@0 17 * @Annotation
Chris@0 18 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
Chris@0 19 *
Chris@0 20 * @author Bernhard Schussek <bschussek@gmail.com>
Chris@0 21 */
Chris@0 22 class Choice extends Constraint
Chris@0 23 {
Chris@0 24 const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7';
Chris@0 25 const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e';
Chris@0 26 const TOO_MANY_ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3';
Chris@0 27
Chris@17 28 protected static $errorNames = [
Chris@0 29 self::NO_SUCH_CHOICE_ERROR => 'NO_SUCH_CHOICE_ERROR',
Chris@0 30 self::TOO_FEW_ERROR => 'TOO_FEW_ERROR',
Chris@0 31 self::TOO_MANY_ERROR => 'TOO_MANY_ERROR',
Chris@17 32 ];
Chris@0 33
Chris@0 34 public $choices;
Chris@0 35 public $callback;
Chris@0 36 public $multiple = false;
Chris@0 37 public $strict = false;
Chris@0 38 public $min;
Chris@0 39 public $max;
Chris@0 40 public $message = 'The value you selected is not a valid choice.';
Chris@0 41 public $multipleMessage = 'One or more of the given values is invalid.';
Chris@0 42 public $minMessage = 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.';
Chris@0 43 public $maxMessage = 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.';
Chris@0 44
Chris@0 45 /**
Chris@0 46 * {@inheritdoc}
Chris@0 47 */
Chris@0 48 public function getDefaultOption()
Chris@0 49 {
Chris@0 50 return 'choices';
Chris@0 51 }
Chris@0 52 }