Download the PHP package phprise/data-transfer-object without Composer
On this page you can find all versions of the php package phprise/data-transfer-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phprise/data-transfer-object
More information about phprise/data-transfer-object
Files in phprise/data-transfer-object
Package data-transfer-object
Short Description The initial Data Transfer Object to generate your own DTOs applying OTAKU philosophy
License MIT
Informations about the package data-transfer-object
Data Transfer Object
A strict, no-nonsense Data Transfer Object (DTO) library for PHP, following the OTAKU Philosophy.
It simplifies data transport between layers of your application, ensuring type safety and automatic mapping between snake_case (common in databases/APIs) and camelCase (standard in PHP).
Installation
Usage
Basic Usage
Define your DTO by extending Phprise\DataTransferObject\TransferObject and adding public typed properties.
Snake Case Magic
The library automatically handles conversion between snake_case keys and camelCase properties.
Nested DTOs
You can nest DTOs. The library will recursively hydrate them.
DateTime Support
Strings in standard formats (ISO 8601 / RFC 3339) are automatically converted to DateTimeImmutable objects if typed as such.
JSON Serialization
Philosophy
We follow The OTAKU Manifesto: Fluid Structure Design.
- O - Own your Discipline (Be strict with yourself)
- T - Tools for Composition (Compose like Unix)
- A - Armor the Core (Protect the heart of the business)
- K - Keep Infrastructure Silent (Infrastructure is just a detail)
- U - Universal Language & Contracts (Speak the user's language via clear contracts)
Please read more about it in PHILOSOPHY.md.
License
MIT License. Free to use, modify, and distribute.
Contributing
See how to contribute in CONTRIBUTING.md.
All versions of data-transfer-object with dependencies
phprise/common-contract Version ^1.0
doctrine/collections Version ^2.4