Skip to content

Repository files navigation

Data Transfer Object

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

Releases

Packages

Used by

Contributors

Languages