Download the PHP package picamator/transfer-object without Composer
On this page you can find all versions of the php package picamator/transfer-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download picamator/transfer-object
More information about picamator/transfer-object
Files in picamator/transfer-object
Package transfer-object
Short Description A modern Symfony-compatible Transfer Object Generator with property hooks, FixedArray, and asymmetric visibilities.
License MIT
Informations about the package transfer-object
Transfer Object Generator
Would you like to build Symfony-compatible Transfer Objects?
You're in the right place! 🎉
Imagine you have a Rest API response:
Running the following interactive console command:
Generates a YML
definition file:
Then, running another console command:
Builds the Transfer Object:
Key Features
Symfony Compatability:
- Provides Symfony console command:
- TransferGeneratorCommand
- TransferGeneratorBulkCommand
- DefinitionGeneratorCommand
- Includes Symfony services:
- TransferGeneratorFacade
- DefinitionGeneratorFacade
- Enables Symfony request data mapping.
Transfer Object:
- Offers methods:
fromArray()
toArray()
toFilterArray()
- Implements standard interfaces:
IteratorAggregate
JsonSerializable
Countable
- Handles embedded and collection Transfer Objects.
- Works with PHP primitive data types.
- Extends compatibility to advanced types:
BackedEnum
DateTime
DateTimeImmutable
BcMath\Number
- Supports asymmetric property visibility.
- Integrates with external Transfer Objects.
Installation
Composer installation:
Examples
- Definition Generator
- Transfer Generator
- Advanced Transfer Generator
Usage Tests
Definition Files and Transfer Object generators have been tested against the following APIs:
- NASA Open Api
- OpenWeather
- Content API for Shopping
- Frankfurter is a free, open-source currency data API
- Tagesschau API
Scenario
- Rest API response is used as a blueprint to generate Definition Files
- Transfer Objects are generated based on Definition Files
- Transfer Object instance is created with the API response
- Transfer Object is converted back to the array
- The converted array is compared with the API response
For all APIs, data are ✅ matched.
For detailed information, please check DefinitionGeneratorFacadeTest.
Documentation
For more details, please visit project's wiki.
Publications
Acknowledgment
Many thanks ❤️ for your contribution, support, feedback and simply using the Transfer Object Generator!
Contribution
If you find this project useful, please ⭐ star the repository. Follow the project to stay updated with all activities.
If you have suggestions for improvements or new features, feel free to:
- Create an issue
- Submit a pull request
Here is a Contribution Guide.
This project is released with a Code of Conduct. By participating in this project and its community, you agree to abide by those terms.
License
Transfer Object Generator is free and open-source software licensed under the MIT License.
For more details, please see the LICENSE file.
All versions of transfer-object with dependencies
composer-runtime-api Version ^2.2
symfony/console Version ^7.3
symfony/filesystem Version ^7.3
symfony/finder Version ^7.3
symfony/yaml Version ^7.3