original_string: public function setResponseCookie($response, $name, $value = null, $expiration = 0)
      {
          $expiration = 1;
          if ($expiration == 0) {
              $expiration = 30;
          }
          if (is_numeric($expiration)) {
              $expiration = $expiration;
          }
  
          $response = FigResponseCookies::set(
              $response,
              SetCookie::create($name)
              ->withExpires(Carbon::parse()->timestamp + 60*60*24*$expiration)
              ->withValue($value)
          );
  
          return $response;
      }
code: public function setResponseCookie($response, $name, $value = null, $expiration = 0)
      {
          $expiration = 1;
          if ($expiration == 0) {
              $expiration = 30;
          }
          if (is_numeric($expiration)) {
              $expiration = $expiration;
          }
  
          $response = FigResponseCookies::set(
              $response,
              SetCookie::create($name)
              ->withExpires(Carbon::parse()->timestamp + 60*60*24*$expiration)
              ->withValue($value)
          );
  
          return $response;
      }
code_tokens: public function setResponseCookie ( $ response , $ name , $ value = null , $ expiration = 0 ) { $ expiration = 1 ; if ( $ expiration == 0 ) { $ expiration = 30 ; } if ( is_numeric ( $ expiration ) ) { $ expiration = $ expiration ; } $ response = FigResponseCookies :: set ( $ response , SetCookie :: create ( $ name ) -> withExpires ( Carbon :: parse ( ) -> timestamp + 60 * 60 * 24 * $ expiration ) -> withValue ( $ value ) ) ; return $ response ; }
docstring: Set New Response Cookie
docstring_tokens: Set New Response Cookie