original_string: public function repaginate_next_slot($nextslotnumber, $type) {
          $currentslotnumber = $nextslotnumber - 1;
          if (!($currentslotnumber && $nextslotnumber)) {
              return null;
          }
          $currentslot = $this->get_this_slot($this->slots, $currentslotnumber);
          $nextslot = $this->get_this_slot($this->slots, $nextslotnumber);
  
          if ($type === self::LINK) {
              return $this->repaginate_this_slot($nextslot, $currentslot->page);
          } else if ($type === self::UNLINK) {
              return $this->repaginate_this_slot($nextslot, $nextslot->page + 1);
          }
          return null;
      }
code: public function repaginate_next_slot($nextslotnumber, $type) {
          $currentslotnumber = $nextslotnumber - 1;
          if (!($currentslotnumber && $nextslotnumber)) {
              return null;
          }
          $currentslot = $this->get_this_slot($this->slots, $currentslotnumber);
          $nextslot = $this->get_this_slot($this->slots, $nextslotnumber);
  
          if ($type === self::LINK) {
              return $this->repaginate_this_slot($nextslot, $currentslot->page);
          } else if ($type === self::UNLINK) {
              return $this->repaginate_this_slot($nextslot, $nextslot->page + 1);
          }
          return null;
      }
code_tokens: public function repaginate_next_slot ( $ nextslotnumber , $ type ) { $ currentslotnumber = $ nextslotnumber - 1 ; if ( ! ( $ currentslotnumber && $ nextslotnumber ) ) { return null ; } $ currentslot = $ this -> get_this_slot ( $ this -> slots , $ currentslotnumber ) ; $ nextslot = $ this -> get_this_slot ( $ this -> slots , $ nextslotnumber ) ; if ( $ type === self :: LINK ) { return $ this -> repaginate_this_slot ( $ nextslot , $ currentslot -> page ) ; } else if ( $ type === self :: UNLINK ) { return $ this -> repaginate_this_slot ( $ nextslot , $ nextslot -> page + 1 ) ; } return null ; }
docstring: Repaginate next slot and return the modified slot object
  @param int $nextslotnumber
  @param int $type repaginate::LINK or repaginate::UNLINK.
  @return stdClass|null
docstring_tokens: Repaginate next slot and return the modified slot object