src/Serializer/AbstractCollectionNormalizer.php
protected function getPaginationConfig($object, array $context = []): array
    {
        $currentPage = $lastPage = $itemsPerPage = $pageTotalItems = $totalItems = null;
        $paginated = $paginator = false;

        if ($object instanceof PartialPaginatorInterface) {
            $paginated = $paginator = true;
            if ($object instanceof PaginatorInterface) {
                $paginated = 1. !== $lastPage = $object->getLastPage();
                $totalItems = $object->getTotalItems();
            } else {
                $pageTotalItems = (float) \count($object);
            }

            $currentPage = $object->getCurrentPage();
            $itemsPerPage = $object->getItemsPerPage();
        } elseif (\is_array($object) || $object instanceof \Countable) {
            $totalItems = \count($object);
        }

        return [$paginator, $paginated, $currentPage, $itemsPerPage, $lastPage, $pageTotalItems, $totalItems];
    }
protected function getPaginationConfig($object, array $context = []): array
    {
        $currentPage = $lastPage = $itemsPerPage = $pageTotalItems = $totalItems = null;
        $paginated = $paginator = false;

        if ($object instanceof PartialPaginatorInterface) {
            $paginated = $paginator = true;
            if ($object instanceof PaginatorInterface) {
                $paginated = 1. !== $lastPage = $object->getLastPage();
                $totalItems = $object->getTotalItems();
            } else {
                $pageTotalItems = (float) \count($object);
            }

            $currentPage = $object->getCurrentPage();
            $itemsPerPage = $object->getItemsPerPage();
        } elseif (\is_array($object) || $object instanceof \Countable) {
            $totalItems = \count($object);
        }

        return [$paginator, $paginated, $currentPage, $itemsPerPage, $lastPage, $pageTotalItems, $totalItems];
    }
protected function getPaginationConfig ( $ object , array $ context = [ ] ) : array { $ currentPage = $ lastPage = $ itemsPerPage = $ pageTotalItems = $ totalItems = null ; $ paginated = $ paginator = false ; if ( $ object instanceof PartialPaginatorInterface ) { $ paginated = $ paginator = true ; if ( $ object instanceof PaginatorInterface ) { $ paginated = 1. !== $ lastPage = $ object -> getLastPage ( ) ; $ totalItems = $ object -> getTotalItems ( ) ; } else { $ pageTotalItems = ( float ) \ count ( $ object ) ; } $ currentPage = $ object -> getCurrentPage ( ) ; $ itemsPerPage = $ object -> getItemsPerPage ( ) ; } elseif ( \ is_array ( $ object ) || $ object instanceof \ Countable ) { $ totalItems = \ count ( $ object ) ; } return [ $ paginator , $ paginated , $ currentPage , $ itemsPerPage , $ lastPage , $ pageTotalItems , $ totalItems ] ; }
Gets the pagination configuration.

@param iterable $object
Gets the pagination configuration .