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;
    }