Resolver/PaginatorAnnotationResolver.php
private function decidePaginatorFormat(
        DoctrinePaginator $paginator,
        string $parameterType,
        int $limitPerPage,
        int $page
    ) {
        if (Pagerfanta::class === $parameterType) {
            $paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
            $paginator->setMaxPerPage($limitPerPage);
            $paginator->setCurrentPage($page);
        }
        if (PaginationInterface::class === $parameterType) {
            $knp = new KnpPaginator();
            $paginator = $knp->paginate($paginator->getQuery(), $page, $limitPerPage);
        }

        return $paginator;
    }
private function decidePaginatorFormat(
        DoctrinePaginator $paginator,
        string $parameterType,
        int $limitPerPage,
        int $page
    ) {
        if (Pagerfanta::class === $parameterType) {
            $paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
            $paginator->setMaxPerPage($limitPerPage);
            $paginator->setCurrentPage($page);
        }
        if (PaginationInterface::class === $parameterType) {
            $knp = new KnpPaginator();
            $paginator = $knp->paginate($paginator->getQuery(), $page, $limitPerPage);
        }

        return $paginator;
    }
private function decidePaginatorFormat ( DoctrinePaginator $ paginator , string $ parameterType , int $ limitPerPage , int $ page ) { if ( Pagerfanta :: class === $ parameterType ) { $ paginator = new Pagerfanta ( new DoctrineORMAdapter ( $ paginator -> getQuery ( ) ) ) ; $ paginator -> setMaxPerPage ( $ limitPerPage ) ; $ paginator -> setCurrentPage ( $ page ) ; } if ( PaginationInterface :: class === $ parameterType ) { $ knp = new KnpPaginator ( ) ; $ paginator = $ knp -> paginate ( $ paginator -> getQuery ( ) , $ page , $ limitPerPage ) ; } return $ paginator ; }
Return real usable Paginator instance given the definition type.

@param DoctrinePaginator $paginator
@param string            $parameterType
@param int               $limitPerPage
@param int               $page

@return mixed
Return real usable Paginator instance given the definition type .