platform/api/symfony/Component/Validator/Constraints/Choice.yaml
2024-09-02 10:44:11 -07:00

81 lines
4 KiB
YAML

name: Choice
class_comment: null
dependencies:
- name: Constraint
type: class
source: Symfony\Component\Validator\Constraint
properties:
- name: callback
visibility: public
comment: "# * Validates that a value is one of a given set of valid choices.\n#\
\ *\n# * @author Bernhard Schussek <bschussek@gmail.com>\n# */\n# #[\\Attribute(\\\
Attribute::TARGET_PROPERTY | \\Attribute::TARGET_METHOD | \\Attribute::IS_REPEATABLE)]\n\
# class Choice extends Constraint\n# {\n# public const NO_SUCH_CHOICE_ERROR =\
\ '8e179f1b-97aa-4560-a02f-2a8b42e49df7';\n# public const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e';\n\
# public const TOO_MANY_ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3';\n# \n\
# protected const ERROR_NAMES = [\n# self::NO_SUCH_CHOICE_ERROR => 'NO_SUCH_CHOICE_ERROR',\n\
# self::TOO_FEW_ERROR => 'TOO_FEW_ERROR',\n# self::TOO_MANY_ERROR => 'TOO_MANY_ERROR',\n\
# ];\n# \n# public ?array $choices = null;\n# /** @var callable|string|null"
methods:
- name: __construct
visibility: public
parameters:
- name: options
default: '[]'
- name: choices
default: 'null'
- name: callback
default: 'null'
- name: multiple
default: 'null'
- name: strict
default: 'null'
- name: min
default: 'null'
- name: max
default: 'null'
- name: message
default: 'null'
- name: multipleMessage
default: 'null'
- name: minMessage
default: 'null'
- name: maxMessage
default: 'null'
- name: groups
default: 'null'
- name: payload
default: 'null'
- name: match
default: 'null'
comment: "# * Validates that a value is one of a given set of valid choices.\n#\
\ *\n# * @author Bernhard Schussek <bschussek@gmail.com>\n# */\n# #[\\Attribute(\\\
Attribute::TARGET_PROPERTY | \\Attribute::TARGET_METHOD | \\Attribute::IS_REPEATABLE)]\n\
# class Choice extends Constraint\n# {\n# public const NO_SUCH_CHOICE_ERROR =\
\ '8e179f1b-97aa-4560-a02f-2a8b42e49df7';\n# public const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e';\n\
# public const TOO_MANY_ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3';\n# \n\
# protected const ERROR_NAMES = [\n# self::NO_SUCH_CHOICE_ERROR => 'NO_SUCH_CHOICE_ERROR',\n\
# self::TOO_FEW_ERROR => 'TOO_FEW_ERROR',\n# self::TOO_MANY_ERROR => 'TOO_MANY_ERROR',\n\
# ];\n# \n# public ?array $choices = null;\n# /** @var callable|string|null */\n\
# public $callback;\n# public bool $multiple = false;\n# public bool $strict =\
\ true;\n# public ?int $min = null;\n# public ?int $max = null;\n# public string\
\ $message = 'The value you selected is not a valid choice.';\n# public string\
\ $multipleMessage = 'One or more of the given values is invalid.';\n# public\
\ string $minMessage = 'You must select at least {{ limit }} choice.|You must\
\ select at least {{ limit }} choices.';\n# public string $maxMessage = 'You must\
\ select at most {{ limit }} choice.|You must select at most {{ limit }} choices.';\n\
# public bool $match = true;\n# \n# public function getDefaultOption(): ?string\n\
# {\n# return 'choices';\n# }\n# \n# /**\n# * @param array|null $choices\
\ An array of choices (required unless a callback is specified)\n# * @param callable|string|null\
\ $callback Callback method to use instead of the choice option to get the choices\n\
# * @param bool|null $multiple Whether to expect the value to be an\
\ array of valid choices (defaults to false)\n# * @param bool|null \
\ $strict This option defaults to true and should not be used\n# * @param int|null\
\ $min Minimum of valid choices if multiple values are expected\n\
# * @param int|null $max Maximum of valid choices if multiple\
\ values are expected\n# * @param string[]|null $groups\n# * @param bool|null\
\ $match Whether to validate the values are part of the choices\
\ or not (defaults to true)"
traits:
- Symfony\Component\Validator\Constraint
interfaces: []