PHP Класс Symfony\Component\Validator\ConstraintValidator

Автор: Bernhard Schussek ([email protected])
Наследование: implements Symfony\Component\Validator\ConstraintValidatorInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$context ExecutionContextInterface2Dot5

Открытые методы

Метод Описание
initialize ( Symfony\Component\Validator\Context\ExecutionContextInterface $context )

Защищенные методы

Метод Описание
formatTypeOf ( mixed $value ) : string Returns a string representation of the type of the value.
formatValue ( mixed $value, integer $format ) : string Returns a string representation of the value.
formatValues ( array $values, integer $format ) : string Returns a string representation of a list of values.

Описание методов

formatTypeOf() защищенный Метод

This method should be used if you pass the type of a value as message parameter to a constraint violation. Note that such parameters should usually not be included in messages aimed at non-technical people.
protected formatTypeOf ( mixed $value ) : string
$value mixed The value to return the type of
Результат string The type of the value

formatValue() защищенный Метод

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 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.
protected formatValue ( mixed $value, integer $format ) : string
$value mixed The value to format as string
$format integer A bitwise combination of the format constants in this class
Результат string The string representation of the passed value

formatValues() защищенный Метод

Each of the values is converted to a string using {@link formatValue()}. The values are then concatenated with commas.
См. также: formatValue()
protected formatValues ( array $values, integer $format ) : string
$values array A list of values
$format integer A bitwise combination of the format constants in this class
Результат string The string representation of the value list

initialize() публичный Метод

public initialize ( Symfony\Component\Validator\Context\ExecutionContextInterface $context )
$context Symfony\Component\Validator\Context\ExecutionContextInterface

Описание свойств

$context защищенное свойство

protected ExecutionContextInterface2Dot5 $context
Результат ExecutionContextInterface2Dot5