title: Symfony - ChoiceType Form - Array to string conversion error
body: <p>I'm trying to make a form with a choice type input on the field roles on my entity user.
  However, Symfony reply me an error "Array to string conversion error"</p>
  
  <p>My roles don't have to be an array because the are not multiple (role hierarchy in security.yaml).</p>
  
  <p>Here is my Form Builder : </p>
  
  <pre><code> $builder
          -&gt;add('email')
          -&gt;add('prenom')
          -&gt;add('nom')
          -&gt;add('password', PasswordType::Class)
          -&gt;add('confirm_password', PasswordType::Class)
          -&gt;add('roles', ChoiceType::class, [
              'choices'  =&gt; [
                  'Utilisateur' =&gt; "ROLE_USER",
                  'Valideur' =&gt; "ROLE_VALIDEUR",
                  'Administrateur' =&gt; "ROLE_ADMIN",                    
              ],
  
          ])
  </code></pre>
  
  <p>And my User entity :</p>
  
  <pre><code>class User implements UserInterface
  {
  /**
   * @ORM\Id()
   * @ORM\GeneratedValue()
   * @ORM\Column(type="integer")
   */
  private $id;
  
  /**
   * @ORM\Column(type="string", length=255)
   * @Assert\Length(min="8", minMessage="Votre mot de passe doit contenir au moins 8 carractères")
   */
  private $password;
  
  /**
   * @Assert\EqualTo(propertyPath="password", message="Vous n'avez pas tapé le même mot de passe")
   */
  private $confirm_password;
  
  /**
   * @ORM\Column(type="simple_array")
   */
  private $roles = array();
  
  /**
   * @ORM\Column(type="string", length=255)
   * @Assert\NotBlank
   */
  private $prenom;
  
  /**
   * @ORM\Column(type="string", length=255)
   * @Assert\NotBlank
   */
  private $nom;
  
  /**
   * @ORM\Column(type="string", length=255)
   * @Assert\Email()
   * @Assert\NotBlank
   */
  private $email;
  
  
  
  public function getId(): ?int
  {
      return $this-&gt;id;
  }
  
  public function getPassword(): ?string
  {
      return $this-&gt;password;
  }
  
  public function setPassword(string $password): self
  {
      $this-&gt;password = $password;
  
      return $this;
  }
  
  public function getConfirmPassword(): ?string
  {
      return $this-&gt;confirm_password;
  }
  
  public function setConfirmPassword(string $confirm_password): self
  {
      $this-&gt;confirm_password = $confirm_password;
  
      return $this;
  }
  
  public function getRoles(): array
  {
      return array_unique($this-&gt;roles);
  }
  
  public function setRoles(array $roles): self
  {
      $this-&gt;roles = $roles;
  
      return $this;
  }
  
  public function getPrenom(): ?string
  {
      return $this-&gt;prenom;
  }
  
  public function setPrenom(?string $prenom): self
  {
      $this-&gt;prenom = $prenom;
  
      return $this;
  }
  
  public function getNom(): ?string
  {
      return $this-&gt;nom;
  }
  
  public function setNom(?string $nom): self
  {
      $this-&gt;nom = $nom;
  
      return $this;
  }
  
  public function getEmail(): ?string
  {
      return $this-&gt;email;
  }
  
  public function setEmail(string $email): self
  {
      $this-&gt;email = $email;
  
      return $this;
  } 
  
  public function getUsername(): ?string
  {
      return $this-&gt;email;
  }
  
  public function eraseCredentials()
  {
  }
  
  public function getSalt()
  {
  }
  }
  </code></pre>
  
  <p>Could you explain me where are the problems in my user Entity (or somewhere else) please ?</p>