ValidatorTypeGuesser::guessRequiredForConstraint()

ValueGuess|null guessRequiredForConstraint(Constraint $constraint) Guesses whether a field is required based on the given constraint. Parameters Constraint $constraint The constraint to guess for Return Value ValueGuess|null The guess whether the field is required

ValidatorTypeGuesser::guessRequired()

ValueGuess guessRequired(string $class, string $property) Returns a guess whether a property of a class is required. Parameters string $class The fully qualified class name string $property The name of the property to guess for Return Value ValueGuess A guess for the field's required setting

ValidatorTypeGuesser::guessPatternForConstraint()

ValueGuess|null guessPatternForConstraint(Constraint $constraint) Guesses a field's pattern based on the given constraint. Parameters Constraint $constraint The constraint to guess for Return Value ValueGuess|null The guess for the pattern

ValidatorTypeGuesser::guessPattern()

ValueGuess|null guessPattern(string $class, string $property) Returns a guess about the field's pattern. When you have a min value, you guess a min length of this min (LOW_CONFIDENCE) , lines below If this value is a float type, this is wrong so you guess null with MEDIUM_CONFIDENCE to override the previous guess. Example: You want a float greater than 5, 4.512313 is not valid but length(4.512314) > length(5) Parameters string $class The fully qualified class name string $

ValidatorTypeGuesser::guessMaxLengthForConstraint()

ValueGuess|null guessMaxLengthForConstraint(Constraint $constraint) Guesses a field's maximum length based on the given constraint. Parameters Constraint $constraint The constraint to guess for Return Value ValueGuess|null The guess for the maximum length

ValidatorTypeGuesser::guessMaxLength()

ValueGuess|null guessMaxLength(string $class, string $property) Returns a guess about the field's maximum length. Parameters string $class The fully qualified class name string $property The name of the property to guess for Return Value ValueGuess|null A guess for the field's maximum length

ValidatorTypeGuesser

class ValidatorTypeGuesser implements FormTypeGuesserInterface Methods __construct(MetadataFactoryInterface $metadataFactory) TypeGuess|null guessType(string $class, string $property) Returns a field guess for a property name of a class. ValueGuess guessRequired(string $class, string $property) Returns a guess whether a property of a class is required. ValueGuess|null guessMaxLength(string $class, string $property) Returns a guess about the field's maximum length. ValueG

ValidatorInterface::validatePropertyValue()

ConstraintViolationListInterface validatePropertyValue(object|string $objectOrClass, string $propertyName, mixed $value, array|null $groups = null) Validates a value against the constraints specified for an object's property. Parameters object|string $objectOrClass The object or its class name string $propertyName The name of the property mixed $value The value to validate against the property's constraints array|null $groups The validation groups to validate. If none is given

ValidatorInterface::validateProperty()

ConstraintViolationListInterface validateProperty(object $object, string $propertyName, array|null $groups = null) Validates a property of an object against the constraints specified for this property. Parameters object $object The object string $propertyName The name of the validated property array|null $groups The validation groups to validate. If none is given, "Default" is assumed Return Value ConstraintViolationListInterface A list of constraint violations If the list is

ValidatorInterface::validate()

ConstraintViolationListInterface validate(mixed $value, Constraint|Constraint[] $constraints = null, array|null $groups = null) Validates a value against a constraint or a list of constraints. If no constraint is passed, the constraint {@link \Symfony\Component\Validator\Constraints\Valid} is assumed. Parameters mixed $value The value to validate Constraint|Constraint[] $constraints The constraint(s) to validate against array|null $groups The validation groups to validate. If