title: Symfony doctrine returns objects instead of arrays
body: <p>I have no idea why, but after a few (unrelated) changes all my returns are objects instead of arrays. For example:</p>
  
  <p>ReceiptController.php</p>
  
  <pre><code>/**
   * Get all receipts for the team.
   *
   * @param String $id
   * @return array
   *
   * @SWG\Response(
   *     response=201,
   *     description="Get all receipt for the team.",
   *     @SWG\Schema(
   *         type="array"
   *     )
   * )
   */
  public function getTeamReceiptsAction($id): array
  {
      $parameterBag = [
          'teamId' =&gt; $id
      ];
  
      $items = $this-&gt;manager-&gt;getAll($parameterBag);
  
      return $items;
  }
  </code></pre>
  
  <p>Receiptrepository</p>
  
  <pre><code>/**
   * @inheritdoc
   */
  public function getFilterQuery($parameterBag): QueryBuilder
  {
      $qb = $this
          -&gt;createQueryBuilder('s')
      ;
  
      if (isset($parameterBag['id'])) {
          $qb-&gt;andWhere('s.id=(:id)')
              -&gt;setParameter('id', $parameterBag['id']);
      }
  
      if (isset($parameterBag['teamId'])) {
          $qb-&gt;andWhere('s.team=(:team)')
              -&gt;setParameter('team', $parameterBag['teamId']);
      }
  
      return $qb;
  }
  
  
  /**
   * @inheritdoc
   */
  public function getAll($parameterBag): ?array
  {
      $qb = $this-&gt;getFilterQuery($parameterBag);
  
      return $qb-&gt;getQuery()-&gt;getResult();
  }
  </code></pre>
  
  <p>Returns: 
  <code>{"0":{"email":"admin@benj.be","first_name"...</code>
  While i would expect <code>[{"email":"admin@benj.be","first_name"...</code> ?</p>
  
  <p>So it returns an object with multiple objects in it instead of an array.</p>
  
  <p>But that's weird, because all my functions are typed to return array's, and I don't get any errors?</p>