title: in_array() expects parameter 2 to be array, null given
body: <p>I made a web-application with Symfony2, and I'm using PUGX User Bundle and FosUserBundle to manage 2 different users.</p>
  
  <p>This is one of the two user:</p>
  
  <pre><code>  /**
     * @ORM\Entity
     * @ORM\Table(name="user_Operator")
     * @ORM\HasLifecycleCallbacks()
     * @UniqueEntity(fields = "username", targetClass = "Acme\ManagementBundle\Entity\User", message="Username already_used")
     * @UniqueEntity(fields = "email", targetClass = "Acme\ManagementBundle\Entity\User", message="Email already_used")
     */
    class UserOperator extends User
    {
        /**
         * @ORM\Id
         * @ORM\Column(type="integer")
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        protected $id;
  
            /**
         * @ORM\PrePersist
         */
        public function setCreatedAtValue()
        {
            $this-&gt;addRole('ROLE_OPERATOR');
        }    
    }
  </code></pre>
  
  <p>When I try to register, I fill the form, submit, than appears:</p>
  
  <pre><code>Warning: in_array() expects parameter 2 to be array, null given in C:\BitNami\wampstack-
  5.4.23-0\frameworks\symfony\vendor\friendsofsymfony\user-    
  bundle\FOS\UserBundle\Model\User.php line 142
  </code></pre>
  
  <p>The line 142 is the following:</p>
  
  <pre><code>   135    public function addRole($role)
            {
                $role = strtoupper($role);
                if ($role === static::ROLE_DEFAULT) {
                    return $this;
                }
  
     142        if (!in_array($role, $this-&gt;roles, true)) {
                    $this-&gt;roles[] = $role;
                }
  
                return $this;
            }
  </code></pre>
  
  <p>Don't know because I have this problem since I made an association @ORM\ManyToMany between User and Mission, that is another entity that here doesn't appear. Before this I hadn't this problem.</p>
  
  <p>I use PUGXUser Bundle because it helps to easily manage two different kind of user. The User Entity is in my bundle, extends FosUserBundle..../Model/User.php and is extended by UserOperator and UserGroundStation. </p>
  
  <p>The definition of the role is in the FosUserBundle.../Model/User.php:</p>
  
  <pre><code>/**
   * @var array
   */
  protected $roles;
  </code></pre>
  
  <p>and the costruct is:</p>
  
  <pre><code>public function __construct()
  {
      $this-&gt;roles = array();
  }
  </code></pre>