title: Symfony Invalid parameter format, : given
body: <p>I need create multiply search by years. From request  I get string like <code>2017,2018</code> and then I want get <code>Questions</code> which <code>createdAt</code>, between from start year and end year. I have query builder with part, and I'am not understand why I have this error</p>
  
  <pre><code>        if ($paramFetcher-&gt;get('years')) {
  
          $orXSearch = $qb-&gt;expr()-&gt;orX();
          $yearData = trim($paramFetcher-&gt;get('years'));
          foreach (explode(',', $yearData) as $key =&gt; $id) {
              if (!$id) {
                  continue;
              }
  
              $orXSearch
                  -&gt;add($qb-&gt;expr()-&gt;between('q.createdAt', ':'.$key.'dateFrom', ':'.$key.'dateTo'));
  
              $date = $this-&gt;additionalFunction-&gt;validateDateTime($id, 'Y');
              $first = clone $date;
              $first-&gt;setDate($date-&gt;format('Y'), 1, 1);
              $first-&gt;setTime(0, 0, 0);
              $last = clone $date;
              $last-&gt;setDate($date-&gt;format('Y'), 12, 31);
              $last-&gt;setTime(23, 59   , 59);
  
              $qb
                  -&gt;setParameter($key.'dateFrom', $first-&gt;format('Y-m-d H:i:s'))
                  -&gt;setParameter($key.'dateTo', $last-&gt;format('Y-m-d H:i:s'));
          }
          $qb-&gt;andWhere($orXSearch);
      }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>symfony Invalid parameter format, : given, but :&lt;name&gt; or ?&lt;num&gt; expected.
  </code></pre>