Common library for DTOs
composer require codin-pro/data-transfer-object
or
"require": {
"codin-pro/data-transfer-object": "^1.0"
}
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.
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