protected function getPageFromQueryParams(array $query_params)
    {
        $page = 1;

        if (isset($query_params['page'])) {
            $page = (integer) $query_params['page'];
        }

        return $page < 1 ? 1 : $page;
    }