original_string: public function calculate_expiry($timestamp) {
          $expiry = null;
  
          if (isset($this->expiredate)) {
              $expiry = $this->expiredate;
          } else if (isset($this->expireperiod)) {
              $expiry = $timestamp + $this->expireperiod;
          }
  
          return $expiry;
      }
code: public function calculate_expiry($timestamp) {
          $expiry = null;
  
          if (isset($this->expiredate)) {
              $expiry = $this->expiredate;
          } else if (isset($this->expireperiod)) {
              $expiry = $timestamp + $this->expireperiod;
          }
  
          return $expiry;
      }
code_tokens: public function calculate_expiry ( $ timestamp ) { $ expiry = null ; if ( isset ( $ this -> expiredate ) ) { $ expiry = $ this -> expiredate ; } else if ( isset ( $ this -> expireperiod ) ) { $ expiry = $ timestamp + $ this -> expireperiod ; } return $ expiry ; }
docstring: Calculates badge expiry date based on either expirydate or expiryperiod.
  
  @param int $timestamp Time of badge issue
  @return int A timestamp
docstring_tokens: Calculates badge expiry date based on either expirydate or expiryperiod .