original_string: public function updateFromSetCookie(array $setCookies, $uri = null)
      {
          $cookies = [];
  
          foreach ($setCookies as $cookie) {
              foreach (explode(',', $cookie) as $i => $part) {
                  if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
                      $cookies[] = ltrim($part);
                  } else {
                      $cookies[\count($cookies) - 1] .= ','.$part;
                  }
              }
          }
  
          foreach ($cookies as $cookie) {
              try {
                  $this->set(Cookie::fromString($cookie, $uri));
              } catch (\InvalidArgumentException $e) {
                  // invalid cookies are just ignored
              }
          }
      }
code: public function updateFromSetCookie(array $setCookies, $uri = null)
      {
          $cookies = [];
  
          foreach ($setCookies as $cookie) {
              foreach (explode(',', $cookie) as $i => $part) {
                  if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
                      $cookies[] = ltrim($part);
                  } else {
                      $cookies[\count($cookies) - 1] .= ','.$part;
                  }
              }
          }
  
          foreach ($cookies as $cookie) {
              try {
                  $this->set(Cookie::fromString($cookie, $uri));
              } catch (\InvalidArgumentException $e) {
                  // invalid cookies are just ignored
              }
          }
      }
code_tokens: public function updateFromSetCookie ( array $ setCookies , $ uri = null ) { $ cookies = [ ] ; foreach ( $ setCookies as $ cookie ) { foreach ( explode ( ',' , $ cookie ) as $ i => $ part ) { if ( 0 === $ i || preg_match ( '/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/' , $ part ) ) { $ cookies [ ] = ltrim ( $ part ) ; } else { $ cookies [ \ count ( $ cookies ) - 1 ] .= ',' . $ part ; } } } foreach ( $ cookies as $ cookie ) { try { $ this -> set ( Cookie :: fromString ( $ cookie , $ uri ) ) ; } catch ( \ InvalidArgumentException $ e ) { // invalid cookies are just ignored } } }
docstring: Updates the cookie jar from a response Set-Cookie headers.
  
  @param array  $setCookies Set-Cookie headers from an HTTP response
  @param string $uri        The base URL
docstring_tokens: Updates the cookie jar from a response Set - Cookie headers .