original_string: public function paginate()
      {
          $this->total = $this->dataSource->getTotal($this->source);
  
          if (
              ($this->getPagesCount() > 0 && $this->getPage() > $this->getPagesCount()) ||
              $this->getPage() <= 0
          ) {
              $this->handler->wrongPageCallback();
          }
  
          $this->data = $this->dataSource->applyLimit(
              $this->source,
              $this->getPage(),
              $this->getPageSize()
          );
  
          return $this->data;
      }
code: public function paginate()
      {
          $this->total = $this->dataSource->getTotal($this->source);
  
          if (
              ($this->getPagesCount() > 0 && $this->getPage() > $this->getPagesCount()) ||
              $this->getPage() <= 0
          ) {
              $this->handler->wrongPageCallback();
          }
  
          $this->data = $this->dataSource->applyLimit(
              $this->source,
              $this->getPage(),
              $this->getPageSize()
          );
  
          return $this->data;
      }
code_tokens: public function paginate ( ) { $ this -> total = $ this -> dataSource -> getTotal ( $ this -> source ) ; if ( ( $ this -> getPagesCount ( ) > 0 && $ this -> getPage ( ) > $ this -> getPagesCount ( ) ) || $ this -> getPage ( ) <= 0 ) { $ this -> handler -> wrongPageCallback ( ) ; } $ this -> data = $ this -> dataSource -> applyLimit ( $ this -> source , $ this -> getPage ( ) , $ this -> getPageSize ( ) ) ; return $ this -> data ; }
docstring: Apply limits to source.
  
  @throws \Exception
  
  @return array
docstring_tokens: Apply limits to source .