-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
ValidatoractionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)
Description
Currently, the basic examples of constraints like GreaterThan don't use the short version for default options:
class Person
{
/**
* @Assert\GreaterThan(
* value = 18
* )
*/
protected $age;
}
The proper (short) way of writing this would be:
class Person
{
/**
* @Assert\GreaterThan(18)
*/
protected $age;
}
I think the "Basic Usage" examples should be fixed in this direction. In addition, a new section "Message Customization" should be added that shows how to write the constraint when customizing the message:
class Person
{
/**
* @Assert\GreaterThan(
* value = 18,
* message = "Restricted to persons older than 18 years."
* )
*/
protected $age;
}
The above applies for all configuration styles (annotations, PHP, XML and YAML).
Metadata
Metadata
Assignees
Labels
ValidatoractionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)