93 lines
3.1 KiB
YAML
93 lines
3.1 KiB
YAML
name: ConstraintValidator
|
|
class_comment: null
|
|
dependencies:
|
|
- name: ExecutionContextInterface
|
|
type: class
|
|
source: Symfony\Component\Validator\Context\ExecutionContextInterface
|
|
properties: []
|
|
methods:
|
|
- name: formatTypeOf
|
|
visibility: protected
|
|
parameters:
|
|
- name: value
|
|
comment: "# * Base class for constraint validators.\n# *\n# * @author Bernhard Schussek\
|
|
\ <bschussek@gmail.com>\n# */\n# abstract class ConstraintValidator implements\
|
|
\ ConstraintValidatorInterface\n# {\n# /**\n# * Whether to format {@link \\DateTime}\
|
|
\ objects, either with the {@link \\IntlDateFormatter}\n# * (if it is available)\
|
|
\ or as RFC-3339 dates (\"Y-m-d H:i:s\").\n# */\n# public const PRETTY_DATE =\
|
|
\ 1;\n# \n# /**\n# * Whether to cast objects with a \"__toString()\" method to\
|
|
\ strings.\n# */\n# public const OBJECT_TO_STRING = 2;\n# \n# protected ExecutionContextInterface\
|
|
\ $context;\n# \n# public function initialize(ExecutionContextInterface $context):\
|
|
\ void\n# {\n# $this->context = $context;\n# }\n# \n# /**\n# * Returns a string\
|
|
\ representation of the type of the value.\n# *\n# * This method should be used\
|
|
\ if you pass the type of a value as\n# * message parameter to a constraint violation.\
|
|
\ Note that such\n# * parameters should usually not be included in messages aimed\
|
|
\ at\n# * non-technical people."
|
|
- name: formatValue
|
|
visibility: protected
|
|
parameters:
|
|
- name: value
|
|
- name: format
|
|
default: '0'
|
|
comment: '# * Returns a string representation of the value.
|
|
|
|
# *
|
|
|
|
# * This method returns the equivalent PHP tokens for most scalar types
|
|
|
|
# * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped
|
|
|
|
# * in double quotes ("). Objects, arrays and resources are formatted as
|
|
|
|
# * "object", "array" and "resource". If the $format bitmask contains
|
|
|
|
# * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted
|
|
|
|
# * with the {@link \IntlDateFormatter}. If it is not available, they will be
|
|
|
|
# * formatted as RFC-3339 dates ("Y-m-d H:i:s").
|
|
|
|
# *
|
|
|
|
# * Be careful when passing message parameters to a constraint violation
|
|
|
|
# * that (may) contain objects, arrays or resources. These parameters
|
|
|
|
# * should only be displayed for technical users. Non-technical users
|
|
|
|
# * won''t know what an "object", "array" or "resource" is and will be
|
|
|
|
# * confused by the violation message.
|
|
|
|
# *
|
|
|
|
# * @param int $format A bitwise combination of the format constants in this class'
|
|
- name: formatValues
|
|
visibility: protected
|
|
parameters:
|
|
- name: values
|
|
- name: format
|
|
default: '0'
|
|
comment: '# * Returns a string representation of a list of values.
|
|
|
|
# *
|
|
|
|
# * Each of the values is converted to a string using
|
|
|
|
# * {@link formatValue()}. The values are then concatenated with commas.
|
|
|
|
# *
|
|
|
|
# * @param array $values A list of values
|
|
|
|
# * @param int $format A bitwise combination of the format
|
|
|
|
# * constants in this class
|
|
|
|
# *
|
|
|
|
# * @see formatValue()'
|
|
traits:
|
|
- Symfony\Component\Validator\Context\ExecutionContextInterface
|
|
interfaces:
|
|
- ConstraintValidatorInterface
|