private function getSliceEnd($siblings) { return max(1, min($this->getNumberOfPages(), $this->currentPage + $siblings)); }