{"id":15089653,"url":"https://github.com/chubbyphp/chubbyphp-decode-encode","last_synced_at":"2025-04-11T22:07:54.254Z","repository":{"id":57680272,"uuid":"493332991","full_name":"chubbyphp/chubbyphp-decode-encode","owner":"chubbyphp","description":"Chubbyphp decode/encode json/jsonx/url-encoded/xml/yaml","archived":false,"fork":false,"pushed_at":"2025-03-12T14:09:37.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T22:07:52.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/chubbyphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-17T16:35:56.000Z","updated_at":"2025-03-12T14:09:41.000Z","dependencies_parsed_at":"2024-03-13T21:28:35.922Z","dependency_job_id":"f25e713a-6779-4da4-adad-dabeddd33d1b","html_url":"https://github.com/chubbyphp/chubbyphp-decode-encode","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"fd6fee039b1f7814895ce51f80f053ed362b6492"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-decode-encode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-decode-encode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-decode-encode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-decode-encode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chubbyphp","download_url":"https://codeload.github.com/chubbyphp/chubbyphp-decode-encode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487713,"owners_count":21112191,"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":[],"created_at":"2024-09-25T09:01:07.630Z","updated_at":"2025-04-11T22:07:54.235Z","avatar_url":"https://github.com/chubbyphp.png","language":"PHP","readme":"# chubbyphp-decode-encode\n\n[![CI](https://github.com/chubbyphp/chubbyphp-decode-encode/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-decode-encode/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-decode-encode/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-decode-encode?branch=master)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchubbyphp%2Fchubbyphp-decode-encode%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-decode-encode/master)\n[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-decode-encode/v)](https://packagist.org/packages/chubbyphp/chubbyphp-decode-encode)\n[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-decode-encode/downloads)](https://packagist.org/packages/chubbyphp/chubbyphp-decode-encode)\n[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-decode-encode/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-decode-encode)\n\n[![bugs](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![code_smells](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![coverage](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![duplicated_lines_density](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![ncloc](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![sqale_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![alert_status](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![reliability_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![security_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![sqale_index](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n[![vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-decode-encode\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-decode-encode)\n\n## Description\n\nA simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.\n\n## Requirements\n\n * php: ^8.2\n * symfony/yaml: ^5.4.45|^6.4.18|^7.2\n\n## Suggest\n\n * chubbyphp/chubbyphp-container: ^2.2\n * psr/container: ^1.1.2|^2.0.2\n\n## Installation\n\nThrough [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-decode-encode][1].\n\n```sh\ncomposer require chubbyphp/chubbyphp-decode-encode \"^1.2\"\n```\n\n## Usage\n\n### Decoder\n\n```php\n\u003c?php\n\nuse Chubbyphp\\DecodeEncode\\Decoder\\Decoder;\nuse Chubbyphp\\DecodeEncode\\Decoder\\JsonTypeDecoder;\nuse Chubbyphp\\DecodeEncode\\Decoder\\JsonxTypeDecoder;\nuse Chubbyphp\\DecodeEncode\\Decoder\\UrlEncodedTypeDecoder;\nuse Chubbyphp\\DecodeEncode\\Decoder\\XmlTypeDecoder;\nuse Chubbyphp\\DecodeEncode\\Decoder\\YamlTypeDecoder;\n\n$decoder = new Decoder([\n    new JsonTypeDecoder(),\n    new JsonxTypeDecoder(),\n    new UrlEncodedTypeDecoder(),\n    new XmlTypeDecoder(),\n    new YamlTypeDecoder()\n]);\n\nprint_r($decoder-\u003egetContentTypes());\n//[\n//    'application/json',\n//    'application/jsonx+xml',\n//    'application/x-www-form-urlencoded',\n//    'application/xml',\n//    'application/x-yaml'\n//]\n\nprint_r($decoder-\u003edecode(\n    '{\"name\": \"php\"}',\n    'application/json'\n));\n// ['name' =\u003e 'php']\n```\n\n#### Type Decoder\n\n * [JsonTypeDecoder][3]\n * [JsonxTypeDecoder][4]\n * [UrlEncodedTypeDecoder][5]\n * [XmlTypeDecoder][6]\n * [YamlTypeDecoder][7]\n\n### Encoder\n\n# Encoder\n\n```php\n\u003c?php\n\nuse Chubbyphp\\DecodeEncode\\Encoder\\Encoder;\nuse Chubbyphp\\DecodeEncode\\Encoder\\JsonTypeEncoder;\nuse Chubbyphp\\DecodeEncode\\Encoder\\JsonxTypeEncoder;\nuse Chubbyphp\\DecodeEncode\\Encoder\\UrlEncodedTypeEncoder;\nuse Chubbyphp\\DecodeEncode\\Encoder\\XmlTypeEncoder;\nuse Chubbyphp\\DecodeEncode\\Encoder\\YamlTypeEncoder;\n\n$encoder = new Encoder([\n    new JsonTypeEncoder(),\n    new JsonxTypeEncoder(),\n    new UrlEncodedTypeEncoder(),\n    new XmlTypeEncoder(),\n    new YamlTypeEncoder()\n]);\n\nprint_r($encoder-\u003egetContentTypes());\n//[\n//    'application/json',\n//    'application/jsonx+xml',\n//    'application/x-www-form-urlencoded',\n//    'application/xml',\n//    'application/x-yaml'\n//]\n\necho $encoder-\u003eencode(\n    ['name' =\u003e 'php'],\n    'application/json'\n);\n// '{\"name\": \"php\"}'\n```\n\n#### Type Encoder\n\n * [JsonTypeEncoder][11]\n * [JsonxTypeEncoder][12]\n * [UrlEncodedTypeEncoder][13]\n * [XmlTypeEncoder][14]\n * [YamlTypeEncoder][15]\n\n### ServiceFactory\n\n#### chubbyphp-laminas-config-factory\n\n * [DecoderFactory][20]\n * [EncoderFactory][21]\n\n## Copyright\n\n2025 Dominik Zogg\n\n\n[1]: https://packagist.org/packages/chubbyphp/chubbyphp-decode-encode\n\n[3]: doc/Decoder/JsonTypeDecoder.md\n[4]: doc/Decoder/JsonxTypeDecoder.md\n[5]: doc/Decoder/UrlEncodedTypeDecoder.md\n[6]: doc/Decoder/XmlTypeDecoder.md\n[7]: doc/Decoder/YamlTypeDecoder.md\n\n[11]: doc/Encoder/JsonTypeEncoder.md\n[12]: doc/Encoder/JsonxTypeEncoder.md\n[13]: doc/Encoder/UrlEncodedTypeEncoder.md\n[14]: doc/Encoder/XmlTypeEncoder.md\n[15]: doc/Encoder/YamlTypeEncoder.md\n\n[20]: doc/ServiceFactory/DecoderFactory.md\n[21]: doc/ServiceFactory/EncoderFactory.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp%2Fchubbyphp-decode-encode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchubbyphp%2Fchubbyphp-decode-encode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp%2Fchubbyphp-decode-encode/lists"}