Code Duplication    Length = 17-19 lines in 2 locations

lib/Doctrine/ORM/AbstractQuery.php 1 location

@@ 341-357 (lines=17) @@
338
     *
339
     * @return static This query instance.
340
     */
341
    public function setParameters($parameters)
342
    {
343
        // BC compatibility with 2.3-
344
        if (is_array($parameters)) {
345
            $parameterCollection = new ArrayCollection();
346
347
            foreach ($parameters as $key => $value) {
348
                $parameterCollection->add(new Parameter($key, $value));
349
            }
350
351
            $parameters = $parameterCollection;
352
        }
353
354
        $this->parameters = $parameters;
355
356
        return $this;
357
    }
358
359
    /**
360
     * Sets a query parameter.

lib/Doctrine/ORM/QueryBuilder.php 1 location

@@ 566-584 (lines=19) @@
563
     *
564
     * @return self
565
     */
566
    public function setParameters($parameters)
567
    {
568
        // BC compatibility with 2.3-
569
        if (is_array($parameters)) {
570
            $parameterCollection = new ArrayCollection();
571
572
            foreach ($parameters as $key => $value) {
573
                $parameter = new Query\Parameter($key, $value);
574
575
                $parameterCollection->add($parameter);
576
            }
577
578
            $parameters = $parameterCollection;
579
        }
580
581
        $this->parameters = $parameters;
582
583
        return $this;
584
    }
585
586
    /**
587
     * Gets all defined query parameters for the query being constructed.