original_string: public function getPages()
      {
          $pages = [];
  
          if($this->numPages <= 1)
          {
              return [];
          }
  
          if($this->numPages <= $this->maxPagesToShow)
          {
              for($i = 1; $i <= $this->numPages; $i++)
              {
                  $pages[] = $this->createPage($i, $i == $this->currentPage);
              }
          }
          else
          {
              // Determine the sliding range, centered around the current page.
              $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2);
  
              if($this->currentPage + $numAdjacents > $this->numPages)
              {
                  $slidingStart = $this->numPages - $this->maxPagesToShow + 2;
              }
              else
              {
                  $slidingStart = $this->currentPage - $numAdjacents;
              }
              if($slidingStart < 2)
              {
                  $slidingStart = 2;
              }
  
              $slidingEnd = $slidingStart + $this->maxPagesToShow - 3;
              if($slidingEnd >= $this->numPages)
              {
                  $slidingEnd = $this->numPages - 1;
              }
  
              // Build the list of pages.
              $pages[] = $this->createPage(1, $this->currentPage == 1);
              if($slidingStart > 2)
              {
                  $pages[] = $this->createPageEllipsis();
              }
              for($i = $slidingStart; $i <= $slidingEnd; $i++)
              {
                  $pages[] = $this->createPage($i, $i == $this->currentPage);
              }
              if($slidingEnd < $this->numPages - 1)
              {
                  $pages[] = $this->createPageEllipsis();
              }
              $pages[] = $this->createPage($this->numPages, $this->currentPage == $this->numPages);
          }
  
          return $pages;
      }
code: public function getPages()
      {
          $pages = [];
  
          if($this->numPages <= 1)
          {
              return [];
          }
  
          if($this->numPages <= $this->maxPagesToShow)
          {
              for($i = 1; $i <= $this->numPages; $i++)
              {
                  $pages[] = $this->createPage($i, $i == $this->currentPage);
              }
          }
          else
          {
              // Determine the sliding range, centered around the current page.
              $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2);
  
              if($this->currentPage + $numAdjacents > $this->numPages)
              {
                  $slidingStart = $this->numPages - $this->maxPagesToShow + 2;
              }
              else
              {
                  $slidingStart = $this->currentPage - $numAdjacents;
              }
              if($slidingStart < 2)
              {
                  $slidingStart = 2;
              }
  
              $slidingEnd = $slidingStart + $this->maxPagesToShow - 3;
              if($slidingEnd >= $this->numPages)
              {
                  $slidingEnd = $this->numPages - 1;
              }
  
              // Build the list of pages.
              $pages[] = $this->createPage(1, $this->currentPage == 1);
              if($slidingStart > 2)
              {
                  $pages[] = $this->createPageEllipsis();
              }
              for($i = $slidingStart; $i <= $slidingEnd; $i++)
              {
                  $pages[] = $this->createPage($i, $i == $this->currentPage);
              }
              if($slidingEnd < $this->numPages - 1)
              {
                  $pages[] = $this->createPageEllipsis();
              }
              $pages[] = $this->createPage($this->numPages, $this->currentPage == $this->numPages);
          }
  
          return $pages;
      }
code_tokens: public function getPages ( ) { $ pages = [ ] ; if ( $ this -> numPages <= 1 ) { return [ ] ; } if ( $ this -> numPages <= $ this -> maxPagesToShow ) { for ( $ i = 1 ; $ i <= $ this -> numPages ; $ i ++ ) { $ pages [ ] = $ this -> createPage ( $ i , $ i == $ this -> currentPage ) ; } } else { // Determine the sliding range, centered around the current page. $ numAdjacents = ( int ) floor ( ( $ this -> maxPagesToShow - 3 ) / 2 ) ; if ( $ this -> currentPage + $ numAdjacents > $ this -> numPages ) { $ slidingStart = $ this -> numPages - $ this -> maxPagesToShow + 2 ; } else { $ slidingStart = $ this -> currentPage - $ numAdjacents ; } if ( $ slidingStart < 2 ) { $ slidingStart = 2 ; } $ slidingEnd = $ slidingStart + $ this -> maxPagesToShow - 3 ; if ( $ slidingEnd >= $ this -> numPages ) { $ slidingEnd = $ this -> numPages - 1 ; } // Build the list of pages. $ pages [ ] = $ this -> createPage ( 1 , $ this -> currentPage == 1 ) ; if ( $ slidingStart > 2 ) { $ pages [ ] = $ this -> createPageEllipsis ( ) ; } for ( $ i = $ slidingStart ; $ i <= $ slidingEnd ; $ i ++ ) { $ pages [ ] = $ this -> createPage ( $ i , $ i == $ this -> currentPage ) ; } if ( $ slidingEnd < $ this -> numPages - 1 ) { $ pages [ ] = $ this -> createPageEllipsis ( ) ; } $ pages [ ] = $ this -> createPage ( $ this -> numPages , $ this -> currentPage == $ this -> numPages ) ; } return $ pages ; }
docstring: Get an array of paginated page data.
  
  Example:
  array(
  array ('num' => 1,     'call' => '/example/page/1',  'isCurrent' => false),
  array ('num' => '...', 'call' => NULL,               'isCurrent' => false),
  array ('num' => 3,     'call' => '/example/page/3',  'isCurrent' => false),
  array ('num' => 4,     'call' => '/example/page/4',  'isCurrent' => true ),
  array ('num' => 5,     'call' => '/example/page/5',  'isCurrent' => false),
  array ('num' => '...', 'call' => NULL,               'isCurrent' => false),
  array ('num' => 10,    'call' => '/example/page/10', 'isCurrent' => false),
  )
  
  @return array
docstring_tokens: Get an array of paginated page data .