codin-pro/data-transfer-object

Common library for DTOs

v1.0.4 2023-02-21 10:41 UTC

This package is not auto-updated.

Last update: 2024-04-30 20:09:55 UTC


README

Common library for DTOs

Latest Stable Version Scrutinizer Code Quality Build Status Code Coverage Total Downloads License composer.lock available

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:

  1. Keep code quality at 10/10
  2. Keep code coverage at 100%
  3. Don't break back-compatibility