public function addNextPage(Result $result): ? string
    {
        $query = $result->getQuery();
        $urlParameters = $this->generateQueryUrlParameters($result);
        $page = $query->getPage();
        $nextPage = $page + 1;

        if ((($nextPage - 1) * $query->getSize()) > $result->getTotalHits()) {
            return null;
        }

        $urlParameters['page'] = $nextPage;

        return $this->createUrlByUrlParameters(
            $result,
            $urlParameters
        )['route'];
    }
public function addNextPage(Result $result): ? string
    {
        $query = $result->getQuery();
        $urlParameters = $this->generateQueryUrlParameters($result);
        $page = $query->getPage();
        $nextPage = $page + 1;

        if ((($nextPage - 1) * $query->getSize()) > $result->getTotalHits()) {
            return null;
        }

        $urlParameters['page'] = $nextPage;

        return $this->createUrlByUrlParameters(
            $result,
            $urlParameters
        )['route'];
    }
public function addNextPage ( Result $ result ) : ? string { $ query = $ result -> getQuery ( ) ; $ urlParameters = $ this -> generateQueryUrlParameters ( $ result ) ; $ page = $ query -> getPage ( ) ; $ nextPage = $ page + 1 ; if ( ( ( $ nextPage - 1 ) * $ query -> getSize ( ) ) > $ result -> getTotalHits ( ) ) { return null ; } $ urlParameters [ 'page' ] = $ nextPage ; return $ this -> createUrlByUrlParameters ( $ result , $ urlParameters ) [ 'route' ] ; }
Add next page.

@param Result $result

@return string|null
Add next page .