<p dir="auto">There is a problem when i use validation_groups when i render the form, lets say:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Profile
{
    /**
     * @var string $phone
     *
     * @ORM\Column(name=&quot;phone&quot;, type=&quot;string&quot;, length=255, nullable=true)
     * @Assert\NotBlank(groups={&quot;signup&quot;})
     */
    private $phone;

    /**
     * @var string $phone_mobile
     *
     * @ORM\Column(name=&quot;phone_mobile&quot;, type=&quot;string&quot;, length=255, nullable=true)
     * @Assert\NotBlank(groups={&quot;admin&quot;})
     */
    private $phone_mobile;
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Profile</span>
{
    <span class="pl-c">/**</span>
<span class="pl-c">     * @var string $phone</span>
<span class="pl-c">     *</span>
<span class="pl-c">     * @ORM\Column(name="phone", type="string", length=255, nullable=true)</span>
<span class="pl-c">     * @Assert\NotBlank(groups={"signup"})</span>
<span class="pl-c">     */</span>
    <span class="pl-k">private</span> <span class="pl-c1"><span class="pl-c1">$</span>phone</span>;

    <span class="pl-c">/**</span>
<span class="pl-c">     * @var string $phone_mobile</span>
<span class="pl-c">     *</span>
<span class="pl-c">     * @ORM\Column(name="phone_mobile", type="string", length=255, nullable=true)</span>
<span class="pl-c">     * @Assert\NotBlank(groups={"admin"})</span>
<span class="pl-c">     */</span>
    <span class="pl-k">private</span> <span class="pl-c1"><span class="pl-c1">$</span>phone_mobile</span>;
}</pre></div>
<p dir="auto">when i will build the form with the admin validation group, then form still render:</p>
<p dir="auto">required="required" for the phone field, which is only a part of signup validation group.</p>
<p dir="auto">The <code class="notranslate">ValidatorTypeGuesser</code> does not consider the current form's <code class="notranslate">validation_groups</code> option when guessing type. This could be fixed by passing the options array to the guesser methods. The signature of the <code class="notranslate">FormTypeGuesserInterface</code> methods would look like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function guessType($class, $property, array $options = array());"><pre class="notranslate"><code class="notranslate">function guessType($class, $property, array $options = array());
</code></pre></div>
<p dir="auto">The default argument is provided for BC.</p>