symfony/symfony — pull request #12004 by webmozart (2014-09-23 15:17:20+00:00)
Title: [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6645
| License | MIT
| Doc PR | -

Consider the following entity:

```php
class Author
{
/**
* @Assert\NotBlank
*/
private $name;

private $age;
}
```

Right now, the "required" HTML attribute is set for both fields (since the default value of the "required" option is true). IMO this is wrong.

With this fix, the ValidatorTypeGuesser guesses `false` for the "required" option unless a NotNull/NotBlank constraint is present.