Added guessers for Size and SizeLength constraints
This commit is contained in:
parent
1467bdb868
commit
ee0fe7a2b5
@ -220,6 +220,18 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
|
|||||||
array(),
|
array(),
|
||||||
Guess::HIGH_CONFIDENCE
|
Guess::HIGH_CONFIDENCE
|
||||||
);
|
);
|
||||||
|
case 'Symfony\Component\Validator\Constraints\Size':
|
||||||
|
return new TypeGuess(
|
||||||
|
'number',
|
||||||
|
array(),
|
||||||
|
Guess::LOW_CONFIDENCE
|
||||||
|
);
|
||||||
|
case 'Symfony\Component\Validator\Constraints\SizeLength':
|
||||||
|
return new TypeGuess(
|
||||||
|
'text',
|
||||||
|
array(),
|
||||||
|
Guess::LOW_CONFIDENCE
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,6 +281,16 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
|
|||||||
strlen((string)$constraint->limit),
|
strlen((string)$constraint->limit),
|
||||||
Guess::HIGH_CONFIDENCE
|
Guess::HIGH_CONFIDENCE
|
||||||
);
|
);
|
||||||
|
case 'Symfony\Component\Validator\Constraints\SizeLength':
|
||||||
|
return new ValueGuess(
|
||||||
|
$constraint->max,
|
||||||
|
Guess::HIGH_CONFIDENCE
|
||||||
|
);
|
||||||
|
case 'Symfony\Component\Validator\Constraints\Size':
|
||||||
|
return new ValueGuess(
|
||||||
|
strlen((string)$constraint->max),
|
||||||
|
Guess::HIGH_CONFIDENCE
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,6 +313,16 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
|
|||||||
strlen((string)$constraint->limit),
|
strlen((string)$constraint->limit),
|
||||||
Guess::HIGH_CONFIDENCE
|
Guess::HIGH_CONFIDENCE
|
||||||
);
|
);
|
||||||
|
case 'Symfony\Component\Validator\Constraints\SizeLength':
|
||||||
|
return new ValueGuess(
|
||||||
|
$constraint->min,
|
||||||
|
Guess::HIGH_CONFIDENCE
|
||||||
|
);
|
||||||
|
case 'Symfony\Component\Validator\Constraints\Size':
|
||||||
|
return new ValueGuess(
|
||||||
|
strlen((string)$constraint->min),
|
||||||
|
Guess::HIGH_CONFIDENCE
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user