original_string: public static function fromHeader(string $string): array
      {
          $cookies = \explode(";", $string);
          $result = [];
  
          try {
              foreach ($cookies as $cookie) {
                  $parts = \explode('=', $cookie, 2);
  
                  if (2 !== \count($parts)) {
                      return [];
                  }
  
                  list($name, $value) = $parts;
  
                  // We can safely trim quotes, as they're not allowed within cookie values
                  $result[] = new self(\trim($name), \trim($value, " \t\""));
              }
          } catch (InvalidCookieException $e) {
              return [];
          }
  
          return $result;
      }
code: public static function fromHeader(string $string): array
      {
          $cookies = \explode(";", $string);
          $result = [];
  
          try {
              foreach ($cookies as $cookie) {
                  $parts = \explode('=', $cookie, 2);
  
                  if (2 !== \count($parts)) {
                      return [];
                  }
  
                  list($name, $value) = $parts;
  
                  // We can safely trim quotes, as they're not allowed within cookie values
                  $result[] = new self(\trim($name), \trim($value, " \t\""));
              }
          } catch (InvalidCookieException $e) {
              return [];
          }
  
          return $result;
      }
code_tokens: public static function fromHeader ( string $ string ) : array { $ cookies = \ explode ( ";" , $ string ) ; $ result = [ ] ; try { foreach ( $ cookies as $ cookie ) { $ parts = \ explode ( '=' , $ cookie , 2 ) ; if ( 2 !== \ count ( $ parts ) ) { return [ ] ; } list ( $ name , $ value ) = $ parts ; // We can safely trim quotes, as they're not allowed within cookie values $ result [ ] = new self ( \ trim ( $ name ) , \ trim ( $ value , " \t\"" ) ) ; } } catch ( InvalidCookieException $ e ) { return [ ] ; } return $ result ; }
docstring: Parses the cookies from a 'cookie' header.
  
  Note: Parsing is aborted if there's an invalid value and no cookies are returned.
  
  @param string $string Valid 'cookie' header line.
  
  @return RequestCookie[]
docstring_tokens: Parses the cookies from a cookie header .