codin-pro / data-transfer-object
Common library for DTOs
v1.0.4
2023-02-21 10:41 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^9.3.11
This package is not auto-updated.
Last update: 2026-03-04 04:45:48 UTC
README
Common library for DTOs
Install
composer require codin-pro/data-transfer-object
or
"require": { "codin-pro/data-transfer-object": "^1.0" }
Usage
All you need for your custom DTO is extending from
CodinPro\DataTransferObject\DTO class and
defining fields as protected. That's it!
<?php namespace CodinPro\DataTransferObject; class ExampleDTO extends DTO { protected $foo = true; protected $bar = 'string'; protected $extra = ['a' => 'b']; }
After this "painful" setup, you are ready to go. You can find more usage examples on Wiki.
Contribution
Feel free to create your pull requests. The only requirements are:
- Keep code quality at 10/10
- Keep code coverage at 100%
- Don't break back-compatibility