Code Duplication    Length = 15-17 lines in 2 locations

src/Doctrine/MongoDBPagerProvider.php 1 location

@@ 59-73 (lines=15) @@
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function provide(array $options = array())
60
    {
61
        $options = array_replace($this->baseOptions, $options);
62
63
        $manager = $this->doctrine->getManagerForClass($this->objectClass);
64
        $repository = $manager->getRepository($this->objectClass);
65
66
        $pager = new PagerfantaPager(new Pagerfanta(
67
            new DoctrineODMMongoDBAdapter(call_user_func([$repository, $options['query_builder_method']]))
68
        ));
69
70
        $this->registerListenersService->register($manager, $pager, $options);
71
72
        return $pager;
73
    }
74
}
75

src/Doctrine/PHPCRPagerProvider.php 1 location

@@ 61-77 (lines=17) @@
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function provide(array $options = array())
62
    {
63
        $options = array_replace($this->baseOptions, $options);
64
65
        $manager = $this->doctrine->getManagerForClass($this->objectClass);
66
        $repository = $manager->getRepository($this->objectClass);
67
        
68
        $adapter = new DoctrineODMPhpcrAdapter(
69
            call_user_func([$repository, $options['query_builder_method']], static::ENTITY_ALIAS)
70
        );
71
        
72
        $pager = new PagerfantaPager(new Pagerfanta($adapter));
73
        
74
        $this->registerListenersService->register($manager, $pager, $options);
75
76
        return $pager;
77
    }
78
}
79