{"id":16925498,"url":"https://github.com/gapple/structured-fields","last_synced_at":"2025-03-22T11:31:03.608Z","repository":{"id":43499409,"uuid":"237095380","full_name":"gapple/structured-fields","owner":"gapple","description":"PHP Library for Structured Field Values for HTTP","archived":false,"fork":false,"pushed_at":"2024-02-14T08:08:53.000Z","size":160,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-05-02T01:25:09.495Z","etag":null,"topics":["http","php","rfc8941","structured-fields","structured-headers"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gapple.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["gapple"],"ko_fi":"gapple"}},"created_at":"2020-01-29T22:30:56.000Z","updated_at":"2024-01-02T09:04:26.000Z","dependencies_parsed_at":"2022-09-17T22:20:48.026Z","dependency_job_id":"6894c556-c753-4691-ae7a-c1629fe38253","html_url":"https://github.com/gapple/structured-fields","commit_stats":{"total_commits":127,"total_committers":1,"mean_commits":127.0,"dds":0.0,"last_synced_commit":"822a5c589c9880efa5244e230c5cf12bb6d6e752"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapple%2Fstructured-fields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapple%2Fstructured-fields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapple%2Fstructured-fields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapple%2Fstructured-fields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gapple","download_url":"https://codeload.github.com/gapple/structured-fields/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244951257,"owners_count":20537348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","php","rfc8941","structured-fields","structured-headers"],"created_at":"2024-10-13T20:10:47.346Z","updated_at":"2025-03-22T11:31:03.595Z","avatar_url":"https://github.com/gapple.png","language":"PHP","readme":"Structured Field Values for PHP\n=======================================\n\nParser and serializer for the [Structured Field Values for HTTP][1] specification.\n\n[![Build Status](https://github.com/gapple/structured-fields/actions/workflows/php.yml/badge.svg)](https://github.com/gapple/structured-fields/actions/workflows/php.yml)\n[![Code Coverage](https://codecov.io/gh/gapple/structured-fields/branch/develop/graph/badge.svg)](https://codecov.io/gh/gapple/structured-fields)\n[![Latest Release](https://img.shields.io/github/v/release/gapple/structured-fields)](https://github.com/gapple/structured-fields/releases)\n[![Packagist Downloads](https://img.shields.io/packagist/dm/gapple/structured-fields)](https://packagist.org/packages/gapple/structured-fields)\n\n\nInstallation\n------------\n\nUsing composer:\n\n```\ncomposer require gapple/structured-fields\n```\n\nAPI\n---\n\nThe `Parser` class provides static methods to convert a header string to structured data.  \nIf the string cannot be parsed, a `ParseException` is thrown.\n\n```\nParser::parseItem(string): Item;\nParser::parseList(string): OuterList;\nParser::parseDictionary(string): Dictionary;\n```\n\nThe `Serializer` class provides static methods to convert structured data to a header string.  \nIf the input cannot be serialized, a `SerializeException` is thrown.\n\n```\nSerializer::serializeItem(mixed, ?object): string;\nSerializer::serializeList(iterable): string;\nSerializer::serializeDictionary(object): string;\n```\n\n### Special Types\n`Serializer` will accept `string` or any `Stringable` object as an Item value, \nbut will throw a `SerializeException` if it contains any characters outside the\nprintable ASCII range.\n\nSpecial Item types must use a decorating class in order to be serialized correctly:\n\n- **Byte Sequences** (`\\gapple\\StructuredFields\\Bytes`)  \n  A string containing binary data.  \n\n  `Serializer` and `Parser` handle base64 encoding and decoding the provided string.\n\n\n- **Display Strings** (`\\gapple\\StructuredFields\\DisplayString`)  \n  A string that includes Unicode characters.\n\n  `Serializer` and `Parser` handle percent-encoding and decoding non-ascii characters.\n\n\n- **Tokens** (`\\gapple\\StructuredFields\\Token`)  \n  A short textual word with a restricted character set.\n \n\n- **Dates** (`\\gapple\\StructuredFields\\Date`)  \n  An integer timestamp\n\n  `Serializer` accepts any object that implements `\\DateTimeInterface`.   \n  `Parser` will return a `\\gapple\\StructuredFields\\Date` object.\n\n  \n[1]: https://www.rfc-editor.org/rfc/rfc9651.html\n","funding_links":["https://github.com/sponsors/gapple","https://ko-fi.com/gapple"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgapple%2Fstructured-fields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgapple%2Fstructured-fields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgapple%2Fstructured-fields/lists"}