original_string: public function modifyResponseCookie($response, $name, $value = null, $expiration = 0)
      {
          $expiration = 1;
          if ($expiration == 0) {
              $expiration = 30; //Expire After 30 Days
          }
          if (is_numeric($expiration)) {
              $expiration = $expiration;
          }
  
          $modify = function (SetCookie $setCookie) {
              $value = $setCookie->getValue();
  
              // ... inspect current $value and determine if $value should
              // change or if it can stay the same. in all cases, a cookie
              // should be returned from this callback...
  
              return $setCookie
                  ->withValue($value)
                  ->withExpires($expiration)
              ;
          };
  
          $response = FigResponseCookies::modify($response, $name, $modify);
  
          return $response;
      }
code: public function modifyResponseCookie($response, $name, $value = null, $expiration = 0)
      {
          $expiration = 1;
          if ($expiration == 0) {
              $expiration = 30; //Expire After 30 Days
          }
          if (is_numeric($expiration)) {
              $expiration = $expiration;
          }
  
          $modify = function (SetCookie $setCookie) {
              $value = $setCookie->getValue();
  
              // ... inspect current $value and determine if $value should
              // change or if it can stay the same. in all cases, a cookie
              // should be returned from this callback...
  
              return $setCookie
                  ->withValue($value)
                  ->withExpires($expiration)
              ;
          };
  
          $response = FigResponseCookies::modify($response, $name, $modify);
  
          return $response;
      }
code_tokens: public function modifyResponseCookie ( $ response , $ name , $ value = null , $ expiration = 0 ) { $ expiration = 1 ; if ( $ expiration == 0 ) { $ expiration = 30 ; //Expire After 30 Days } if ( is_numeric ( $ expiration ) ) { $ expiration = $ expiration ; } $ modify = function ( SetCookie $ setCookie ) { $ value = $ setCookie -> getValue ( ) ; // ... inspect current $value and determine if $value should // change or if it can stay the same. in all cases, a cookie // should be returned from this callback... return $ setCookie -> withValue ( $ value ) -> withExpires ( $ expiration ) ; } ; $ response = FigResponseCookies :: modify ( $ response , $ name , $ modify ) ; return $ response ; }
docstring: Modify Response Cookie
docstring_tokens: Modify Response Cookie