{"id":37232110,"url":"https://github.com/picamator/transfer-object","last_synced_at":"2026-01-15T03:47:25.349Z","repository":{"id":268035476,"uuid":"901489175","full_name":"picamator/transfer-object","owner":"picamator","description":"A modern Symfony-compatible Transfer Object Generator with property hooks, FixedArray, and asymmetric visibilities.","archived":false,"fork":false,"pushed_at":"2026-01-11T14:14:42.000Z","size":2751,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T16:05:01.471Z","etag":null,"topics":["automation","code-generator","data-transfer-object","definition-generator","dto","dto-generator","generator","php","symfony","symfony-console","transfer-object","transfer-object-generator"],"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/picamator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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-12-10T18:49:29.000Z","updated_at":"2025-12-07T11:19:57.000Z","dependencies_parsed_at":"2024-12-14T00:19:18.213Z","dependency_job_id":"429ea3b4-669c-4a3f-a88e-5b61041b5488","html_url":"https://github.com/picamator/transfer-object","commit_stats":null,"previous_names":["picamator/transfer-object"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/picamator/transfer-object","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picamator%2Ftransfer-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picamator%2Ftransfer-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picamator%2Ftransfer-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picamator%2Ftransfer-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picamator","download_url":"https://codeload.github.com/picamator/transfer-object/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picamator%2Ftransfer-object/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["automation","code-generator","data-transfer-object","definition-generator","dto","dto-generator","generator","php","symfony","symfony-console","transfer-object","transfer-object-generator"],"created_at":"2026-01-15T03:47:24.676Z","updated_at":"2026-01-15T03:47:25.335Z","avatar_url":"https://github.com/picamator.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Transfer Object Generator](.github/transfer-object-generator.jpg)\n\n[![CI workflow](https://github.com/picamator/transfer-object/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/picamator/transfer-object/actions)\n[![License](https://poser.pugx.org/picamator/transfer-object/license)](https://packagist.org/packages/picamator/transfer-object)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11465/badge)](https://www.bestpractices.dev/projects/11465)\n[![PHP Version Require](https://poser.pugx.org/picamator/transfer-object/require/php)](https://packagist.org/packages/picamator/transfer-object)\n[![Symfony Compatibility](https://img.shields.io/badge/Symfony-%5E8.0-blue)](https://github.com/picamator/transfer-object/tree/development?tab=readme-ov-file#key-features)\n[![Wiki](https://img.shields.io/badge/wiki-available-brightgreen)](https://github.com/picamator/transfer-object/wiki)\n[![Latest Stable Version](https://poser.pugx.org/picamator/transfer-object/v)](https://packagist.org/packages/picamator/transfer-object)\n\nTransfer Object Generator\n==========================\n\nWould you like to build Symfony-compatible Transfer Objects?\n\nYou're in the right place! 🎉\n\nImagine you have a Rest API response:\n\n```json\n{\n    \"firstName\": \"Jan\",\n    \"lastName\": \"Kowalski\"\n}\n```\n\nRunning the following interactive [console command](https://github.com/picamator/transfer-object/wiki/Console-Commands#definition-generate):\n\n```console\n$ ./vendor/bin/definition-generate\n```\n\nGenerates a `YML` [definition file](https://github.com/picamator/transfer-object/wiki/Definition-File):\n\n```yml\nCustomer:\n  firstName:\n    type: string\n  lastName:\n    type: string\n```\n\nThen, running [console command](https://github.com/picamator/transfer-object/wiki/Console-Commands#transfer-generate):\n\n```console\n$ ./vendor/bin/transfer-generate [-c|--configuration CONFIGURATION]\n```\n\nBuilds the Transfer Object:\n\n```php\n$customerTransfer = new CustomerTransfer();\n$customerTransfer-\u003efirstName = 'Jan';\n$customerTransfer-\u003elastName = 'Kowalski';\n```\n\nKey Features\n------------\n\n**Symfony Compatability:**\n\n * Provides Symfony console command:\n   * [TransferGeneratorCommand](/src/Command/TransferGeneratorCommand.php)\n   * [TransferGeneratorBulkCommand](/src/Command/TransferGeneratorBulkCommand.php)\n   * [DefinitionGeneratorCommand](/src/Command/DefinitionGeneratorCommand.php)\n * Includes Symfony services:\n   * [TransferGeneratorFacade](/src/TransferGenerator/TransferGeneratorFacade.php)\n   * [DefinitionGeneratorFacade](/src/DefinitionGenerator/DefinitionGeneratorFacade.php)\n * Enables automatic Symfony request query data mapping\n * Supports [Symfony validator](https://github.com/symfony/validator) attributes\n\n**Transfer Object:**\n\n* Offers methods:\n  * `fromArray()`\n  * `toArray()`\n* Implements standard interfaces:\n  * `IteratorAggregate`\n  * `JsonSerializable`\n  * `Countable`\n* Handles embedded and collection Transfer Objects.\n* Works with PHP primitive data types.\n* Extends compatibility to advanced types:\n  * `BackedEnum`\n  * `DateTime`\n  * `DateTimeImmutable`\n  * `BcMath\\Number`\n* Supports asymmetric property visibility.\n* Integrates with external Transfer Objects.\n\nInstallation\n------------\n\nComposer installation:\n\n```console\n$ composer require picamator/transfer-object\n```\n\n| Version | PHP | Symfony |\n|-------|-----|---------|\n| 4.0.0 | 8.4 | 7.3     |\n| 5.0.0 | 8.5 | 8.0     |\n\nExamples\n---------\n\n* [Definition Generator](/examples/try-definition-generator.php)\n* [Transfer Generator](/examples/try-transfer-generator.php)\n* [Advanced Transfer Generator](/examples/try-advanced-transfer-generator.php)\n\nUsage Tests\n-----------\n\nDefinition Files and Transfer Object generators have been tested against the following APIs:\n\n* [NASA Open Api](https://api.nasa.gov/neo/rest/v1/neo/2465633?api_key=DEMO_KEY)\n* [OpenWeather](https://openweathermap.org/current#example_JSON)\n* [Content API for Shopping](https://developers.google.com/shopping-content/guides/products/products-api?hl=en)\n* [Frankfurter is a free, open-source currency data API](https://api.frankfurter.dev/v1/latest)\n* [Tagesschau API](https://tagesschau.api.bund.dev)\n* [Statistisches Bundesamt (Destatis)](https://www-genesis.destatis.de/genesisWS/swagger-ui/index.html#/find/findPost)\n\n### Scenario\n\n1. Rest API response is used as a blueprint to generate Definition Files\n2. Transfer Objects are generated based on Definition Files\n3. Transfer Object instance is created with the API response\n4. Transfer Object is converted back to the array\n5. The converted array is compared with the API response\n\nFor all APIs, data are ✅ matched.\n\nFor detailed information, please check [DefinitionGeneratorFacadeTest](/tests/integration/DefinitionGenerator/DefinitionGeneratorFacadeTest.php).\n\nDocumentation\n-------------\n\nFor more details, please visit [project's wiki](https://github.com/picamator/transfer-object/wiki).\n\nPublications\n------------\n\n1. [Sergii Pryz, \"Data Transfer Objects and Property Hooks\" PHP Architect Magazine, June 2025](https://www.phparch.com/article/2025-06-data-transfer-objects-and-property-hooks/)\n\nAcknowledgment\n--------------\n\nMany thanks ❤️ for your contribution, support, feedback and simply using the Transfer Object Generator!\n\nContribution\n------------\n\nIf you find this project useful, please ⭐ star the repository.\nFollow the project to stay updated with all activities.\n\nIf you have suggestions for improvements or new features, feel free to:\n\n* Create an issue\n* Submit a pull request\n\nHere is a [Contribution Guide](CONTRIBUTING.md).\n\n\nThis project is released with a [Code of Conduct](CODE_OF_CONDUCT.md).\nBy participating in this project and its community, you agree to abide by those terms.\n\nLicense\n-------\n\nTransfer Object Generator is free and open-source software licensed under the MIT License.\n\nFor more details, please see the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicamator%2Ftransfer-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicamator%2Ftransfer-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicamator%2Ftransfer-object/lists"}