Code Duplication    Length = 12-15 lines in 2 locations

src/Kunstmaan/AdminListBundle/AdminList/Configurator/AbstractDoctrineDBALAdminListConfigurator.php 1 location

@@ 90-104 (lines=15) @@
87
    /**
88
     * @return Pagerfanta
89
     */
90
    public function getPagerfanta()
91
    {
92
        if (is_null($this->pagerfanta)) {
93
            $adapter          = new DoctrineDBALAdapter(
94
                $this->getQueryBuilder(),
95
                $this->getCountField(),
96
                $this->getUseDistinctCount()
97
            );
98
            $this->pagerfanta = new Pagerfanta($adapter);
99
            $this->pagerfanta->setMaxPerPage($this->getLimit());
100
            $this->pagerfanta->setCurrentPage($this->getPage());
101
        }
102
103
        return $this->pagerfanta;
104
    }
105
106
    /**
107
     * @param array $params

src/Kunstmaan/AdminListBundle/AdminList/Configurator/AbstractDoctrineORMAdminListConfigurator.php 1 location

@@ 98-109 (lines=12) @@
95
    /**
96
     * @return Pagerfanta
97
     */
98
    public function getPagerfanta()
99
    {
100
        if (is_null($this->pagerfanta)) {
101
            $adapter          = new DoctrineORMAdapter($this->getQuery());
102
            $this->pagerfanta = new Pagerfanta($adapter);
103
            $this->pagerfanta->setNormalizeOutOfRangePages(true);
104
            $this->pagerfanta->setMaxPerPage($this->getLimit());
105
            $this->pagerfanta->setCurrentPage($this->getPage());
106
        }
107
108
        return $this->pagerfanta;
109
    }
110
111
    /**
112
     * @param QueryBuilder $queryBuilder