{"id":26322802,"url":"https://github.com/chubbyphp-legacy/chubbyphp-serialization","last_synced_at":"2025-03-15T17:08:25.842Z","repository":{"id":56952696,"uuid":"98433814","full_name":"chubbyphp-legacy/chubbyphp-serialization","owner":"chubbyphp-legacy","description":"A simple serialization.","archived":true,"fork":false,"pushed_at":"2025-03-12T20:23:11.000Z","size":590,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T17:08:23.601Z","etag":null,"topics":["api","encoder","hateoas","jms","json","jsonx","normalize","serialize","serializer","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-legacy.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-07-26T14:44:55.000Z","updated_at":"2025-03-12T20:29:46.000Z","dependencies_parsed_at":"2024-03-13T21:25:51.082Z","dependency_job_id":"ff69f919-8529-49ed-9bbb-823c73701ec2","html_url":"https://github.com/chubbyphp-legacy/chubbyphp-serialization","commit_stats":{"total_commits":312,"total_committers":8,"mean_commits":39.0,"dds":"0.28205128205128205","last_synced_commit":"9683c26e1501c7a2710ce65893f5611fa6e90e81"},"previous_names":["chubbyphp-legacy/chubbyphp-serialization","chubbyphp/chubbyphp-serialization"],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-serialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-serialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-serialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-serialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chubbyphp-legacy","download_url":"https://codeload.github.com/chubbyphp-legacy/chubbyphp-serialization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243762269,"owners_count":20343979,"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","encoder","hateoas","jms","json","jsonx","normalize","serialize","serializer","urlencoded","xml","yaml"],"created_at":"2025-03-15T17:08:25.090Z","updated_at":"2025-03-15T17:08:25.825Z","avatar_url":"https://github.com/chubbyphp-legacy.png","language":"PHP","readme":"# chubbyphp-serialization\n\n[![CI](https://github.com/chubbyphp/chubbyphp-serialization/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-serialization/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-serialization/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-serialization?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-serialization%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-serialization/master)\n[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-serialization/v)](https://packagist.org/packages/chubbyphp/chubbyphp-serialization)\n[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-serialization/downloads)](https://packagist.org/packages/chubbyphp/chubbyphp-serialization)\n[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-serialization/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-serialization)\n\n[![bugs](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![code_smells](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![coverage](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![duplicated_lines_density](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![ncloc](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![sqale_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![alert_status](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![reliability_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![security_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![sqale_index](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n[![vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-serialization\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-serialization)\n\n\n## Description\n\nA simple serialization.\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 * doctrine/inflector: ^1.4.4|^2.0.10\n * psr/http-message: ^1.1|^2.0\n * psr/link: ^1.1.1|^2.0.1\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-serialization][1].\n\n```sh\ncomposer require chubbyphp/chubbyphp-serialization \"^4.1\"\n```\n\n## Usage\n\n### Accessor\n\n * [MethodAccessor][2]\n * [PropertyAccessor][3]\n\n### Encoder\n\n * [Encoder][4]\n\n#### Type Encoder\n\n * [JsonTypeEncoder][5]\n * [JsonxTypeEncoder][6]\n * [UrlEncodedTypeEncoder][7]\n * [XmlTypeEncoder][8]\n * [YamlTypeEncoder][9]\n\n### Link\n\n * [Link][10]\n * [LinkBuilder][11]\n\n### Normalizer\n\n * [Normalizer][12]\n\n#### Field Normalizer\n\n * [CallbackFieldNormalizer][13]\n * [DateTimeFieldNormalizer][14]\n * [FieldNormalizer][15]\n\n##### Relation Field Normalizer\n\n * [EmbedManyFieldNormalizer][16]\n * [EmbedOneFieldNormalizer][17]\n * [ReferenceManyFieldNormalizer][18]\n * [ReferenceOneFieldNormalizer][19]\n\n#### Link Normalizer\n\n * [CallbackLinkNormalizer][20]\n\n#### Normalizer Context\n\n * [NormalizerContext][21]\n * [NormalizerContextBuilder][22]\n\n### NormalizerObjectMappingRegistry\n\n* [NormalizerObjectMappingRegistry][23]\n\n### Mapping\n\n#### NormalizationFieldMapping\n\n * [NormalizationFieldMapping][24]\n * [NormalizationFieldMappingBuilder][25]\n\n#### NormalizationLinkMapping\n\n * [NormalizationLinkMapping][26]\n * [NormalizationLinkMappingBuilder][27]\n\n#### NormalizationObjectMapping\n\n * [AdvancecNormalizationObjectMapping][28]\n * [SimpleNormalizationObjectMapping][29]\n\n#### LazyNormalizationObjectMapping\n\n * [CallableNormalizationObjectMapping][30]\n * [LazyNormalizationObjectMapping][31]\n\n### Policy\n\n* [AndPolicy][32]\n* [CallbackPolicy][33]\n* [GroupPolicy][34]\n* [NotPolicy][35]\n* [NullPolicy][36]\n* [OrPolicy][37]\n\n### ServiceFactory\n\n#### chubbyphp-container\n\n * [SerializationServiceFactory][38]\n\n#### chubbyphp-laminas-config-factory\n\n * [EncoderFactory][40]\n * [NormalizerFactory][41]\n * [NormalizerObjectMappingRegistryFactory][42]\n * [SerializerFactory][43]\n\n### ServiceProvider\n\n* [SerializationServiceProvider][39]\n\n### Serializer\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;\nuse Chubbyphp\\Serialization\\Normalizer\\Normalizer;\nuse Chubbyphp\\Serialization\\Normalizer\\NormalizerObjectMappingRegistry;\nuse Chubbyphp\\Serialization\\Serializer;\nuse MyProject\\Serialization\\ModelMapping;\nuse MyProject\\Model\\Model;\nuse Psr\\Http\\Message\\ServerRequestInterface;\n\n$logger = ...;\n\n$serializer = new Serializer(\n    new Normalizer(\n        new NormalizerObjectMappingRegistry([\n            new ModelMapping()\n        ]),\n        $logger\n    ),\n    new Encoder([\n        new JsonTypeEncoder(),\n        new JsonxTypeEncoder(),\n        new UrlEncodedTypeEncoder(),\n        new XmlTypeEncoder(),\n        new YamlTypeEncoder()\n    ])\n);\n\n$model = new Model;\n$model-\u003esetName('php');\n\n$json = $serializer-\u003eserialize(\n    $model,\n    'application/json'\n);\n\necho $json;\n// '{\"name\": \"php\"}'\n\n$model = new Model;\n$model-\u003esetName('php');\n\n$data = $serializer-\u003enormalize(\n    $model\n);\n\nprint_r($data);\n// ['name' =\u003e 'php']\n\nprint_r($serializer-\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 $serializer-\u003eencode(\n    ['name' =\u003e 'php'],\n    'application/json'\n);\n// '{\"name\": \"php\"}'\n```\n\n## Copyright\n\n2025 Dominik Zogg\n\n\n[1]: https://packagist.org/packages/chubbyphp/chubbyphp-serialization\n\n[2]: doc/Accessor/MethodAccessor.md\n[3]: doc/Accessor/PropertyAccessor.md\n\n[4]: doc/Encoder/Encoder.md\n\n[5]: doc/Encoder/JsonTypeEncoder.md\n[6]: doc/Encoder/JsonxTypeEncoder.md\n[7]: doc/Encoder/UrlEncodedTypeEncoder.md\n[8]: doc/Encoder/XmlTypeEncoder.md\n[9]: doc/Encoder/YamlTypeEncoder.md\n\n[10]: doc/Link/Link.md\n[11]: doc/Link/LinkBuilder.md\n\n[12]: doc/Normalizer/Normalizer.md\n\n[13]: doc/Normalizer/CallbackFieldNormalizer.md\n[14]: doc/Normalizer/DateTimeFieldNormalizer.md\n[15]: doc/Normalizer/FieldNormalizer.md\n\n[16]: doc/Normalizer/Relation/EmbedManyFieldNormalizer.md\n[17]: doc/Normalizer/Relation/EmbedOneFieldNormalizer.md\n[18]: doc/Normalizer/Relation/ReferenceManyFieldNormalizer.md\n[19]: doc/Normalizer/Relation/ReferenceOneFieldNormalizer.md\n\n[20]: doc/Normalizer/CallbackLinkNormalizer.md\n\n[21]: doc/Normalizer/NormalizerContext.md\n[22]: doc/Normalizer/NormalizerContextBuilder.md\n\n[23]: doc/Normalizer/NormalizerObjectMappingRegistry.md\n\n[24]: doc/Mapping/NormalizationFieldMapping.md\n[25]: doc/Mapping/NormalizationFieldMappingBuilder.md\n\n[26]: doc/Mapping/NormalizationLinkMapping.md\n[27]: doc/Mapping/NormalizationLinkMappingBuilder.md\n\n[28]: doc/Mapping/AdvancedNormalizationObjectMapping.md\n[29]: doc/Mapping/SimpleNormalizationObjectMapping.md\n\n[30]: doc/Mapping/CallableNormalizationObjectMapping.md\n[31]: doc/Mapping/LazyNormalizationObjectMapping.md\n\n[32]: doc/Policy/AndPolicy.md\n[33]: doc/Policy/CallbackPolicy.md\n[34]: doc/Policy/GroupPolicy.md\n[35]: doc/Policy/NotPolicy.md\n[36]: doc/Policy/NullPolicy.md\n[37]: doc/Policy/OrPolicy.md\n\n[38]: doc/ServiceFactory/SerializationServiceFactory.md\n\n[39]: doc/ServiceProvider/SerializationServiceProvider.md\n\n[40]: doc/ServiceFactory/EncoderFactory.md\n[41]: doc/ServiceFactory/NormalizerFactory.md\n[42]: doc/ServiceFactory/NormalizerObjectMappingRegistryFactory.md\n[43]: doc/ServiceFactory/SerializerFactory.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-serialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-serialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-serialization/lists"}