title: Symfony 4.1.4 - Validation annotation NotBlank is not working when edit object data but it works when adding new object
body: <p>I'm using symfony 4.1.4, I have a wondrous problem, the annotation validation Length is working but NotBlank doesn't work <strong>when edit object</strong> data but it works <strong>when adding new object</strong></p>
  
  <pre><code>/**
   * @ORM\Column(name="purchaser", type="string", length=180)
   * @Assert\NotBlank(message="Purchaser is blank")
   * @Assert\Length(min="10", minMessage=" Purchaser min length ....")
   */
  private $purchaser;
  </code></pre>
  
  <p>This appears when the lenght less 10 and i'ts fine.
  <a href="https://i.stack.imgur.com/PEkha.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PEkha.png" alt="enter image description here"></a></p>
  
  <p>But when is blank I get this error !!</p>
  
  <blockquote>
    <p>Expected argument of type "string", "NULL" given.
    <a href="https://i.stack.imgur.com/2shiA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2shiA.png" alt="enter image description here"></a></p>
  </blockquote>
  
  <p>** ------------------ EDIT-----------------------**</p>
  
  <p>When I remove <strong>String</strong> from the setter then it works !!</p>
  
  <pre><code>    public function setPurchaser(string $purchaser): self
  {
      $this-&gt;purchaser = $purchaser;
  
      return $this;
  }
  </code></pre>
  
  <p>Or if I keep String and adding <strong>= null</strong> then it works good.</p>
  
  <pre><code> public function setPurchaser(string $purchaser = null): self
  </code></pre>