class ValidatorTypeGuesser implements FormTypeGuesserInterface
Methods
| __construct(MetadataFactoryInterface $metadataFactory) | ||
| TypeGuess |
guessType(string $class, string $property)
Returns a field guess for a property name of a class |
|
| Guess |
guessRequired(string $class, string $property)
Returns a guess whether a property of a class is required |
|
| Guess |
guessMaxLength(string $class, string $property)
Returns a guess about the field's maximum length |
|
| Guess |
guessPattern(string $class, string $property)
Returns a guess about the field's pattern |
|
| TypeGuess |
guessTypeForConstraint(Constraint $constraint)
Guesses a field class name for a given constraint |
|
| Guess |
guessRequiredForConstraint(Constraint $constraint)
Guesses whether a field is required based on the given constraint |
|
| Guess |
guessMaxLengthForConstraint(Constraint $constraint)
Guesses a field's maximum length based on the given constraint |
|
| Guess |
guessPatternForConstraint(Constraint $constraint)
Guesses a field's pattern based on the given constraint |
Details
at line 25
public
__construct(MetadataFactoryInterface $metadataFactory)
at line 33
public TypeGuess
guessType(string $class, string $property)
Returns a field guess for a property name of a class
at line 45
public Guess
guessRequired(string $class, string $property)
Returns a guess whether a property of a class is required
at line 59
public Guess
guessMaxLength(string $class, string $property)
Returns a guess about the field's maximum length
at line 71
public Guess
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)
at line 87
public TypeGuess
guessTypeForConstraint(Constraint $constraint)
Guesses a field class name for a given constraint
at line 176
public Guess
guessRequiredForConstraint(Constraint $constraint)
Guesses whether a field is required based on the given constraint
at line 195
public Guess
guessMaxLengthForConstraint(Constraint $constraint)
Guesses a field's maximum length based on the given constraint
at line 221
public Guess
guessPatternForConstraint(Constraint $constraint)
Guesses a field's pattern based on the given constraint