222 lines
6.5 KiB
YAML
222 lines
6.5 KiB
YAML
|
name: Constraint
|
||
|
class_comment: null
|
||
|
dependencies:
|
||
|
- name: ConstraintDefinitionException
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
||
|
- name: InvalidArgumentException
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Exception\InvalidArgumentException
|
||
|
- name: InvalidOptionsException
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Exception\InvalidOptionsException
|
||
|
- name: MissingOptionsException
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Exception\MissingOptionsException
|
||
|
properties: []
|
||
|
methods:
|
||
|
- name: getErrorName
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: errorCode
|
||
|
comment: "# * Contains the properties of a constraint definition.\n# *\n# * A constraint\
|
||
|
\ can be defined on a class, a property or a getter method.\n# * The Constraint\
|
||
|
\ class encapsulates all the configuration required for\n# * validating this class,\
|
||
|
\ property or getter result successfully.\n# *\n# * Constraint instances are immutable\
|
||
|
\ and serializable.\n# *\n# * @author Bernhard Schussek <bschussek@gmail.com>\n\
|
||
|
# */\n# abstract class Constraint\n# {\n# /**\n# * The name of the group given\
|
||
|
\ to all constraints with no explicit group.\n# */\n# public const DEFAULT_GROUP\
|
||
|
\ = 'Default';\n# \n# /**\n# * Marks a constraint that can be put onto classes.\n\
|
||
|
# */\n# public const CLASS_CONSTRAINT = 'class';\n# \n# /**\n# * Marks a constraint\
|
||
|
\ that can be put onto properties.\n# */\n# public const PROPERTY_CONSTRAINT =\
|
||
|
\ 'property';\n# \n# /**\n# * Maps error codes to the names of their constants.\n\
|
||
|
# *\n# * @var array<string, string>\n# */\n# protected const ERROR_NAMES = [];\n\
|
||
|
# \n# /**\n# * Domain-specific data attached to a constraint.\n# */\n# public\
|
||
|
\ mixed $payload;\n# \n# /**\n# * The groups that the constraint belongs to.\n\
|
||
|
# *\n# * @var string[]\n# */\n# public ?array $groups = null;\n# \n# /**\n# *\
|
||
|
\ Returns the name of the given error code.\n# *\n# * @throws InvalidArgumentException\
|
||
|
\ If the error code does not exist"
|
||
|
- name: __construct
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: options
|
||
|
default: 'null'
|
||
|
- name: groups
|
||
|
default: 'null'
|
||
|
- name: payload
|
||
|
default: 'null'
|
||
|
comment: '# * Initializes the constraint with options.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * You should pass an associative array. The keys should be the names of
|
||
|
|
||
|
# * existing properties in this class. The values should be the value for these
|
||
|
|
||
|
# * properties.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Alternatively you can override the method getDefaultOption() to return the
|
||
|
|
||
|
# * name of an existing property. If no associative array is passed, this
|
||
|
|
||
|
# * property is set instead.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * You can force that certain options are set by overriding
|
||
|
|
||
|
# * getRequiredOptions() to return the names of these options. If any
|
||
|
|
||
|
# * option is not set here, an exception is thrown.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param mixed $options The options (as associative array)
|
||
|
|
||
|
# * or the value for the default
|
||
|
|
||
|
# * option (any other type)
|
||
|
|
||
|
# * @param string[] $groups An array of validation groups
|
||
|
|
||
|
# * @param mixed $payload Domain-specific data attached to a constraint
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws InvalidOptionsException When you pass the names of non-existing
|
||
|
|
||
|
# * options
|
||
|
|
||
|
# * @throws MissingOptionsException When you don''t pass any of the options
|
||
|
|
||
|
# * returned by getRequiredOptions()
|
||
|
|
||
|
# * @throws ConstraintDefinitionException When you don''t pass an associative
|
||
|
|
||
|
# * array, but getDefaultOption() returns
|
||
|
|
||
|
# * null'
|
||
|
- name: normalizeOptions
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: options
|
||
|
comment: '# * @return array<string, mixed>'
|
||
|
- name: __set
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: option
|
||
|
- name: value
|
||
|
comment: '# * Sets the value of a lazily initialized option.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Corresponding properties are added to the object on first access. Hence
|
||
|
|
||
|
# * this method will be called at most once per constraint instance and
|
||
|
|
||
|
# * option name.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws InvalidOptionsException If an invalid option name is given'
|
||
|
- name: __get
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: option
|
||
|
comment: '# * Returns the value of a lazily initialized option.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Corresponding properties are added to the object on first access. Hence
|
||
|
|
||
|
# * this method will be called at most once per constraint instance and
|
||
|
|
||
|
# * option name.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws InvalidOptionsException If an invalid option name is given'
|
||
|
- name: __isset
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: option
|
||
|
comment: null
|
||
|
- name: addImplicitGroupName
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: group
|
||
|
comment: '# * Adds the given group if this constraint is in the Default group.'
|
||
|
- name: getDefaultOption
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Returns the name of the default option.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Override this method to define a default option.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @see __construct()'
|
||
|
- name: getRequiredOptions
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Returns the name of the required options.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Override this method if you want to define required options.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return string[]
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @see __construct()'
|
||
|
- name: validatedBy
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Returns the name of the class that validates this constraint.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * By default, this is the fully qualified name of the constraint class
|
||
|
|
||
|
# * suffixed with "Validator". You can override this method to change that
|
||
|
|
||
|
# * behavior.'
|
||
|
- name: getTargets
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Returns whether the constraint can be put onto classes, properties
|
||
|
or
|
||
|
|
||
|
# * both.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * This method should return one or more of the constants
|
||
|
|
||
|
# * Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return string|string[] One or more constant values'
|
||
|
- name: __sleep
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Optimizes the serialized value to minimize storage space.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @internal'
|
||
|
traits:
|
||
|
- Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
||
|
- Symfony\Component\Validator\Exception\InvalidArgumentException
|
||
|
- Symfony\Component\Validator\Exception\InvalidOptionsException
|
||
|
- Symfony\Component\Validator\Exception\MissingOptionsException
|
||
|
interfaces: []
|