codin-pro / data-transfer-object
Common library for DTOs
Installs: 1 971
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^9.3.11
This package is not auto-updated.
Last update: 2024-10-29 22:20:39 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