public function pagerPageRange(PagerViewInterface $pager, $pageRange = null)
    {
        if (null === $pageRange) {
            $pageRange = $this->config->getPageRange();
        }

        $pageNumber = $pager->getCurrentPageNumber();
        $pageCount = $pager->getPageCount();

        if ($pageRange > $pageCount) {
            $pageRange = $pageCount;
        }

        $delta = ceil($pageRange / 2);

        if ($pageNumber - $delta > $pageCount - $pageRange) {
            $lowerBound = $pageCount - $pageRange + 1;
            $upperBound = $pageCount;
        } else {
            if ($pageNumber - $delta < 0) {
                $delta = $pageNumber;
            }

            $offset = $pageNumber - $delta;
            $lowerBound = $offset + 1;
            $upperBound = $offset + $pageRange;
        }

        $pages = array();
        for ($pageNumber = $lowerBound; $pageNumber <= $upperBound; ++$pageNumber) {
            $pages[$pageNumber] = $pageNumber;
        }

        return $pages;
    }