title: Symfony 4 TextType required = false getting Expected argument of type "string", "NULL" given
body: <p>I have a TextType field which is set as below</p>
  
  <p><strong>Type:</strong></p>
  
  <pre><code>        -&gt;add('zipCode',TextType::class, array(
                  'attr' =&gt; array('maxlength' =&gt; 10),
                  'required' =&gt; false,
                  'empty_data' =&gt; null
              )
          )
  </code></pre>
  
  <p>When the data loads from the database the field is null. I just attempt to submit the form and I get </p>
  
  <blockquote>
    <p>Expected argument of type "string", "NULL" given.</p>
    
    <p>at vendor/symfony/property-access/PropertyAccessor.php:174   at
    Symfony\Component\PropertyAccess\PropertyAccessor::throwInvalidArgumentException('Argument
    1 passed to App\Entity\Patients::setZipCode() must be of the type
    string, null given,</p>
  </blockquote>
  
  <p>I'm unsure how to fix this? I WANT the value to be null...?  Perhaps it's cause I'm not loading the initial data right on the form?</p>
  
  <p>Related code below, let me know if you need something further:</p>
  
  <p><strong>Twig:</strong></p>
  
  <pre><code>{{ form_widget(view_form.zipCode, { 'attr': {'class': 'mb-2 mb-sm-0 w-100'} }) }}
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public function view(Request $request)
  {
      $patientId = $request-&gt;query-&gt;get('id');
  
      if (!empty($patientId)) {
          $search = $this-&gt;getDoctrine()
              -&gt;getRepository(Patients::class)
              -&gt;find($patientId);
  
          if (is_null($search))
              $this-&gt;addFlash('danger', 'Invalid Patient');
  
          $form = $this-&gt;createForm(PatientViewType::class,$search);
      }
      else
          $form = $this-&gt;createForm(PatientViewType::class);
  
      dump($request);
  
      $form-&gt;handleRequest($request);
  
      if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
          $view = $form-&gt;getData()();
  
          $entityManager = $this-&gt;getDoctrine()-&gt;getManager();
          $entityManager-&gt;persist($view);
          $entityManager-&gt;flush();
  
          $this-&gt;addFlash('success', 'Patient record updated successfully!');
      }
  
      return $this-&gt;render('patient/view.html.twig', [
          'view_form' =&gt; $form-&gt;createView()
      ]);
  }
  </code></pre>