{"id":14984004,"url":"https://github.com/chubbyphp-legacy/chubbyphp-deserialization","last_synced_at":"2025-08-20T18:33:58.399Z","repository":{"id":19157764,"uuid":"86367650","full_name":"chubbyphp/chubbyphp-deserialization","owner":"chubbyphp","description":"A simple deserialization.","archived":false,"fork":false,"pushed_at":"2024-08-10T19:57:25.000Z","size":678,"stargazers_count":6,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-08T06:33:46.739Z","etag":null,"topics":["api","decoder","denormalize","deserialize","deserializer","jms","json","jsonx","urlencoded","xml","yaml"],"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/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}},"created_at":"2017-03-27T18:02:44.000Z","updated_at":"2024-12-04T00:08:45.000Z","dependencies_parsed_at":"2024-03-13T21:28:30.018Z","dependency_job_id":"9d51fb0f-73e6-4af5-9828-e06a235ac888","html_url":"https://github.com/chubbyphp/chubbyphp-deserialization","commit_stats":{"total_commits":428,"total_committers":11,"mean_commits":38.90909090909091,"dds":"0.20327102803738317","last_synced_commit":"6c61bd1a82a3ff86822e39769e8cd389c5cc7674"},"previous_names":[],"tags_count":103,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-deserialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-deserialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-deserialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-deserialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chubbyphp","download_url":"https://codeload.github.com/chubbyphp/chubbyphp-deserialization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445927,"owners_count":18227060,"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":["api","decoder","denormalize","deserialize","deserializer","jms","json","jsonx","urlencoded","xml","yaml"],"created_at":"2024-09-24T14:08:18.415Z","updated_at":"2025-08-20T18:33:58.373Z","avatar_url":"https://github.com/chubbyphp.png","language":"PHP","readme":"# chubbyphp-deserialization\n\n[![CI](https://github.com/chubbyphp/chubbyphp-deserialization/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-deserialization/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-deserialization/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-deserialization?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-deserialization%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-deserialization/master)\n[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-deserialization/v)](https://packagist.org/packages/chubbyphp/chubbyphp-deserialization)\n[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-deserialization/downloads)](https://packagist.org/packages/chubbyphp/chubbyphp-deserialization)\n[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-deserialization/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-deserialization)\n\n[![bugs](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![code_smells](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![coverage](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![duplicated_lines_density](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![ncloc](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![sqale_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![alert_status](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![reliability_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![security_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![sqale_index](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n[![vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-deserialization\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-deserialization)\n\n## Description\n\nA simple deserialization.\n\nDEPRECATED: No personal interest anymore.\nPlease take a look to [chubbyphp-parsing](https://github.com/chubbyphp/chubbyphp-parsing) its a different concept. But i believe parsing is the way to go instead of deserialze/validate.\n\n## Requirements\n\n * php: ^8.2\n * chubbyphp/chubbyphp-decode-encode: ^1.2\n * psr/http-message: ^1.1|^2.0\n * psr/log: ^2.0|^3.0.2\n\n## Suggest\n\n * chubbyphp/chubbyphp-container: ^2.2\n * pimple/pimple: ^3.5\n * psr/container: ^2.0.2\n * symfony/config: ^5.4.46|^6.4.14|^7.2 (symfony integration)\n * symfony/dependency-injection: ^5.4.46|^6.4.14|^7.2 (symfony integration)\n\n## Installation\n\nThrough [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-deserialization][1].\n\n```sh\ncomposer require chubbyphp/chubbyphp-deserialization \"^4.2\"\n```\n\n## Usage\n\n### Accessor\n\n * [MethodAccessor][2]\n * [PropertyAccessor][3]\n\n### Denormalizer\n\n * [Denormalizer][10]\n\n#### Field Denormalizer\n\n * [CallbackFieldDenormalizer][11]\n * [DateTimeImmutableFieldDenormalizer][12]\n * [FieldDenormalizer][13]\n * [ConvertTypeFieldDenormalizer][14]\n\n##### Relation Field Denormalizer\n\n * [EmbedManyFieldDenormalizer][15]\n * [EmbedOneFieldDenormalizer][16]\n * [ReferenceManyFieldDenormalizer][17]\n * [ReferenceOneFieldDenormalizer][18]\n\n#### Denormalizer Context\n\n * [DenormalizerContext][19]\n * [DenormalizerContextBuilder][20]\n\n### DenormalizerObjectMappingRegistry\n\n* [DenormalizerObjectMappingRegistry][21]\n\n### Deserializer\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;\nuse Chubbyphp\\Deserialization\\Denormalizer\\Denormalizer;\nuse Chubbyphp\\Deserialization\\Denormalizer\\DenormalizerObjectMappingRegistry;\nuse Chubbyphp\\Deserialization\\Deserializer;\nuse MyProject\\Deserialization\\ModelMapping;\nuse MyProject\\Model\\Model;\n\n$logger = ...;\n\n$deserializer = new Deserializer(\n    new Decoder([\n        new JsonTypeDecoder(),\n        new JsonxTypeDecoder(),\n        new UrlEncodedTypeDecoder(),\n        new XmlTypeDecoder(),\n        new YamlTypeDecoder()\n    ]),\n    new Denormalizer(\n        new DenormalizerObjectMappingRegistry([\n            new ModelMapping()\n        ]),\n        $logger\n    )\n);\n\n$model = $deserializer-\u003edeserialize(\n    Model::class,\n    '{\"name\": \"php\"}',\n    'application/json'\n);\n\necho $model-\u003egetName();\n// 'php'\n\nprint_r($deserializer-\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($deserializer-\u003edecode(\n    '{\"name\": \"php\"}',\n    'application/json'\n));\n// ['name' =\u003e 'php']\n\n$model = $denormalizer-\u003edenormalize(\n    Model::class,\n    ['name' =\u003e 'php']\n);\n\necho $model-\u003egetName();\n// 'php'\n```\n\n### Mapping\n\n#### DenormalizationFieldMapping\n\n * [DenormalizationFieldMapping][21]\n * [DenormalizationFieldMappingFactory][22]\n\n#### DenormalizationObjectMapping\n\n * [AdvancedDenormalizationObjectMapping][23]\n * [SimpleDenormalizationObjectMapping][24]\n\n#### LazyDenormalizationObjectMapping\n\n * [CallableDenormalizationObjectMapping][25]\n * [LazyDenormalizationObjectMapping][26]\n\n### Policy\n\n* [AndPolicy][27]\n* [CallbackPolicy][28]\n* [GroupPolicy][29]\n* [NotPolicy][30]\n* [NullPolicy][31]\n* [OrPolicy][32]\n\n### ServiceFactory\n\n#### chubbyphp-container\n\n * [DeserializationServiceFactory][33]\n\n#### chubbyphp-laminas-config-factory\n\n * [DenormalizationFieldMappingFactoryFactory][41]\n * [DenormalizerFactory][42]\n * [DenormalizerObjectMappingRegistryFactory][43]\n * [DeserializerFactory][44]\n\n### ServiceProvider\n\n* [DeserializationServiceProvider][34]\n\n## Copyright\n\n2025 Dominik Zogg\n\n\n[1]: https://packagist.org/packages/chubbyphp/chubbyphp-deserialization\n\n[2]: doc/Accessor/MethodAccessor.md\n[3]: doc/Accessor/PropertyAccessor.md\n\n[10]: doc/Denormalizer/Denormalizer.md\n\n[11]: doc/Denormalizer/CallbackFieldDenormalizer.md\n[12]: doc/Denormalizer/DateTimeImmutableFieldDenormalizer.md\n[13]: doc/Denormalizer/FieldDenormalizer.md\n[14]: doc/Denormalizer/ConvertTypeFieldDenormalizer.md\n\n[15]: doc/Denormalizer/Relation/EmbedManyFieldDenormalizer.md\n[16]: doc/Denormalizer/Relation/EmbedOneFieldDenormalizer.md\n[17]: doc/Denormalizer/Relation/ReferenceManyFieldDenormalizer.md\n[18]: doc/Denormalizer/Relation/ReferenceOneFieldDenormalizer.md\n\n[19]: doc/Denormalizer/DenormalizerContext.md\n[20]: doc/Denormalizer/DenormalizerContextBuilder.md\n\n[21]: doc/Denormalizer/DenormalizerObjectMappingRegistry.md\n\n[21]: doc/Mapping/DenormalizationFieldMapping.md\n[22]: doc/Mapping/DenormalizationFieldMappingFactory.md\n\n[23]: doc/Mapping/AdvancedDenormalizationObjectMapping.md\n[24]: doc/Mapping/SimpleDenormalizationObjectMapping.md\n\n[25]: doc/Mapping/CallableDenormalizationObjectMapping.md\n[26]: doc/Mapping/LazyDenormalizationObjectMapping.md\n\n[27]: doc/Policy/AndPolicy.md\n[28]: doc/Policy/CallbackPolicy.md\n[29]: doc/Policy/GroupPolicy.md\n[30]: doc/Policy/NotPolicy.md\n[31]: doc/Policy/NullPolicy.md\n[32]: doc/Policy/OrPolicy.md\n\n[33]: doc/ServiceFactory/DeserializationServiceFactory.md\n\n[34]: doc/ServiceProvider/DeserializationServiceProvider.md\n\n[41]: doc/ServiceFactory/DenormalizationFieldMappingFactoryFactory.md\n[42]: doc/ServiceFactory/DenormalizerFactory.md\n[43]: doc/ServiceFactory/DenormalizerObjectMappingRegistryFactory.md\n[44]: doc/ServiceFactory/DeserializerFactory.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-deserialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-deserialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-deserialization/lists"}