{"id":28609686,"url":"https://github.com/zolex/vom","last_synced_at":"2026-02-27T16:22:39.258Z","repository":{"id":219713024,"uuid":"749731141","full_name":"zolex/vom","owner":"zolex","description":"Versatile Object Mapper for PHP. Map arbitrary data to strictly typed models using attributes.","archived":false,"fork":false,"pushed_at":"2026-01-15T14:01:09.000Z","size":830,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-27T05:21:21.259Z","etag":null,"topics":["data-structures","hydration","mapping","normalization","transformation"],"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/zolex.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-29T09:32:42.000Z","updated_at":"2026-01-15T13:59:38.000Z","dependencies_parsed_at":"2024-01-29T10:49:22.739Z","dependency_job_id":"546c5105-1c77-46b6-9091-a7aad6dbc784","html_url":"https://github.com/zolex/vom","commit_stats":null,"previous_names":["zolex/vom"],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/zolex/vom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolex%2Fvom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolex%2Fvom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolex%2Fvom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolex%2Fvom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zolex","download_url":"https://codeload.github.com/zolex/vom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolex%2Fvom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29903623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T14:46:13.553Z","status":"ssl_error","status_checked_at":"2026-02-27T14:46:10.522Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-structures","hydration","mapping","normalization","transformation"],"created_at":"2025-06-11T22:01:53.466Z","updated_at":"2026-02-27T16:22:39.245Z","avatar_url":"https://github.com/zolex.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Versatile Object Mapper\n\n[![Release](https://github.com/zolex/vom/workflows/Release/badge.svg)](https://github.com/zolex/vom/actions/workflows/release.yaml)\n[![Version](https://img.shields.io/packagist/v/zolex/vom)](https://packagist.org/packages/zolex/vom)\n[![Integration](https://github.com/zolex/vom/workflows/Integration/badge.svg)](https://github.com/zolex/vom/actions/workflows/integration.yaml)\n[![Code Coverage](https://codecov.io/gh/zolex/vom/graph/badge.svg?token=RI2NX4S89I)](https://codecov.io/gh/zolex/vom)\n[![License](https://img.shields.io/packagist/l/zolex/vom)](./LICENSE)\n[![Downloads](https://img.shields.io/packagist/dt/zolex/vom)](https://packagist.org/packages/zolex/vom)\n\n![VOM](docs/logo.png)\n\n![PHP](https://img.shields.io/badge/php-%23777BB4.svg?style=for-the-badge\u0026logo=php\u0026logoColor=white)\n![Symfony](https://img.shields.io/badge/symfony-%23000000.svg?style=for-the-badge\u0026logo=symfony\u0026logoColor=white)\n![Laravel](https://img.shields.io/badge/laravel-%23FF2D20.svg?style=for-the-badge\u0026logo=laravel\u0026logoColor=white)\n\n\nThe Versatile Object Mapper - or in short VOM - is a PHP library to transform any data structure into strictly typed models (and back) by adding PHP 8 attributes.\nIt extends symfony/serializer functionality and is heavily inspired by doctrine and API-Platform, so that advanced mappings can simply be defined on the model classes instead of writing normalizer decorators.\n\n- [Documentation](https://zolex.github.io/vom/)\n- [Examples repository](https://github.com/zolex/vom-examples).\n\n## Installation\n\nVOM is available on packagist. To install, simply require it via composer.\n\n```bash\ncomposer require zolex/vom ^2.0\n```\n\n## Quickstart\n\nTo give you a basic idea of what VOM does, here is a first short example.\n\nGiven, your application receives the following array of values from somewhere.\n\n```php\n$data = [\n    'firstname' =\u003e 'Jane',\n    'surname' =\u003e 'Doe',\n    'street' =\u003e 'Samplestreet 123',\n    'city' =\u003e 'Worsthausen',\n    'zip' =\u003e '12345',\n    'country_name' =\u003e 'United Kingdom',\n    'email_address' =\u003e 'jane.doe@mailprovider.net',\n    'phone' =\u003e '0123456789'\n];\n```\n\nUsually you would write some code that creates the model instances, sets their properties and nests them properly.\nIn very simple scenarios, writing the transformation logic as code might be a good choice, but it can be a pain when it comes to very huge models, the input data structures\nand/or application models change while still in development, or if you want to reuse the transformation logic in other projects too, because it receives the same inputs and/or uses the same models.\n\n### How it works using VOM\n\nInstead of writing business logic that feeds your models, with VOM you simply configure the models using PHP attributes.\n\n```php\nuse Zolex\\VOM\\Mapping as VOM;\n\n#[VOM\\Model]\nclass Person\n{\n    #[VOM\\Property]\n    public string $firstname;\n    \n    #[VOM\\Property('[surname]')]\n    public string $lastname;\n    \n    #[VOM\\Property(accessor: false)]\n    public Address $address;\n    \n    #[VOM\\Property(accessor: false)]\n    public Contact $contact;\n}\n\n#[VOM\\Model]\nclass Address\n{\n    #[VOM\\Property]\n    public string $street;\n    \n    #[VOM\\Property('[zip]')]\n    public string $zipCode;\n    \n    #[VOM\\Property]\n    public string $city;\n    \n    #[VOM\\Property('[country_name]')]\n    public string $country; \n}\n\n#[VOM\\Model]\nclass Contact\n{\n    #[VOM\\Property('[email_address]')]\n    public string $email;\n    \n    #[VOM\\Property]\n    public string $phone;\n}\n```\n\nTo create instances of your models, you simply pass the data to the `denormalize()` method.\n\n```php\n$person = $objectMapper-\u003edenormalize($data, Person::class);\n``` \n\nYou may have noticed, that some property attributes have arguments while others don't. For all details on that, head to the [full documentation](https://zolex.github.io/vom/).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributors\n\n\u003ctable\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/zolex\"\u003e\n                    \u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/398739?v=4\u0026h=75\u0026w=75\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"75;\" alt=\"zolex\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eAndreas Linden\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/sengaigibon\"\u003e\n                    \u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/16040734?v=4\u0026h=75\u0026w=75\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"75;\" alt=\"zolex\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eJavier Caballero \u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003ctbody\u003e\n\u003c/table\u003e\n\n## Special thanks\n\n\u003ctable\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://blackfire.io\" target=\"_blank\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/8961067?v=4\" width=\"75\" alt=\"Blackfire\" /\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://blackfire.io\"\u003eBlackfire\u003c/a\u003e for supporting this project with a free license, leading to VOM performance gains.               \n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003ctbody\u003e\n\u003c/table\u003e\n\n## Alternatives\n\nThere are many Mapping/Transformation/Hydration libraries out there. In case you don't want to rely on `symfony/serializer`, `symfony/proerty-access`, `symfony/type-info` and `phpdocumentor/reflection-docblock` which VOM depends on, here are some alternative packages that cover the same topic with quite different approaches and features.\n\n- [jms/serializer](https://github.com/schmittjoh/serializer)\n- [CuyZ/Valinor](https://github.com/CuyZ/Valinor)\n- [rekalogika/mapper](https://github.com/rekalogika/mapper)\n- [Crell/Serde](https://github.com/Crell/Serde)\n- [thephpleague/object-mapper](https://github.com/thephpleague/object-mapper)\n- [eventsauce/object-hydrator](https://github.com/EventSaucePHP/ObjectHydrator)\n- [spatie/laravel-data](https://github.com/spatie/laravel-data)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzolex%2Fvom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzolex%2Fvom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzolex%2Fvom/lists"}