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

@@ 577-595 (lines=19) @@
574
     *
575
     * @return self
576
     */
577
    public function setParameters($parameters)
578
    {
579
        // BC compatibility with 2.3-
580
        if (is_array($parameters)) {
581
            $parameterCollection = new ArrayCollection();
582
583
            foreach ($parameters as $key => $value) {
584
                $parameter = new Query\Parameter($key, $value);
585
586
                $parameterCollection->add($parameter);
587
            }
588
589
            $parameters = $parameterCollection;
590
        }
591
592
        $this->parameters = $parameters;
593
594
        return $this;
595
    }
596
597
    /**
598
     * Gets all defined query parameters for the query being constructed.