Code Duplication    Length = 12-15 lines in 2 locations

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

@@ 85-99 (lines=15) @@
82
    /**
83
     * @return Pagerfanta
84
     */
85
    public function getPagerfanta()
86
    {
87
        if (\is_null($this->pagerfanta)) {
88
            $adapter = new DoctrineDBALAdapter(
89
                $this->getQueryBuilder(),
90
                $this->getCountField(),
91
                $this->getUseDistinctCount()
92
            );
93
            $this->pagerfanta = new Pagerfanta($adapter);
94
            $this->pagerfanta->setMaxPerPage($this->getLimit());
95
            $this->pagerfanta->setCurrentPage($this->getPage());
96
        }
97
98
        return $this->pagerfanta;
99
    }
100
101
    public function adaptQueryBuilder(
102
        QueryBuilder $queryBuilder,

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

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