PHPackages                             drewkimberly/php\_dtos - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. drewkimberly/php\_dtos

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

drewkimberly/php\_dtos
======================

A simple PHP Data Transfer Object (DTO) library.

v1.2.0(6y ago)03MITPHPPHP &gt;=7.2

Since May 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Drew-Kimberly/php_dtos)[ Packagist](https://packagist.org/packages/drewkimberly/php_dtos)[ RSS](/packages/drewkimberly-php-dtos/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

PHP Data Transfer Objects (DTOs)
================================

[](#php-data-transfer-objects-dtos)

A simple PHP DTO library.

[![PHP version](https://camo.githubusercontent.com/06353b0edce6ab661eda2a51863e70edc4e8e3ff8bdf000ac01fb2c1a8e6342e/68747470733a2f2f62616467652e667572792e696f2f70682f647265776b696d6265726c792532467068705f64746f732e737667)](https://badge.fury.io/ph/drewkimberly%2Fphp_dtos)[![Build Status](https://camo.githubusercontent.com/83b6ffbcafa1d627aacb1b1d3f43c033af140b8842b8f4e24dbe2491ac904a80/68747470733a2f2f7472617669732d63692e6f72672f447265772d4b696d6265726c792f7068705f64746f732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Drew-Kimberly/php_dtos)[![Coverage Status](https://camo.githubusercontent.com/52ab3985b02a9bdbe462193505ac56d9f1f120cbf145e635e6accb4a1853ce8e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f447265772d4b696d6265726c792f7068705f64746f732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Drew-Kimberly/php_dtos?branch=master)

### Installation:

[](#installation)

```
composer require drewkimberly/php_dtos
```

### Usage:

[](#usage)

This library aims to make it easy to create Data Transfer Objects (DTOs). DTOs are simple encapsulations of data, independent of application or domain-specific logic. They are serializable objects, making them a clean way to represent data in the transfer layer of an application (i.e. REST API payloads).

The following table highlights the main classes introduced by this library:

ClassResponsibility`\php_dtos\Dto\DtoBase`Subclass of all DTOs implemented in an application.`\php_dtos\Dto\DtoCollection`Represents a DTO collection in an application. In rare cases this class can be subclassed, but the typical usecase should look something like: `new DtoCollection(MyDto::class);`, where the collection is instantiated with a reference to the underlying (or collected) DTO instance.`\php_dtos\Json\JsonReader`Helper class for safely parsing incoming JSON.For more information on Data Transfer Objects, see:

-
- [https://en.wikipedia.org/wiki/Data\_transfer\_object](https://en.wikipedia.org/wiki/Data_transfer_object)

### Development

[](#development)

#### Setup

[](#setup)

1. Fork this repository
2. Clone your forked repository
3. From the root of your cloned repository run: `composer install`

#### Testing

[](#testing)

[TravisCI](https://travis-ci.org/) is used for CI/CD. The following validations are performed against every Pull Request:

1. [PHPLint](https://github.com/overtrue/phplint)
2. [PHP Codesniffer (PSR2 Sniff)](https://github.com/squizlabs/PHP_CodeSniffer)
3. [PHPUnit](https://phpunit.de/)

#### Deployment

[](#deployment)

When a tag is cut, TravisCI will deploy the package to packagist.

#### Contributing

[](#contributing)

1. Open an Issue on GitHub.
2. Open a Pull Request.
    - Make sure the [TravisCI](https://travis-ci.org/Drew-Kimberly/php_dtos) build is passing for your PR.
    - Request a Code Review on your PR.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a7aa070acd99aef54dbba83a8287cc301c0d6c13ba2714560c385bb9d1a06bc?d=identicon)[uncledrewbie](/maintainers/uncledrewbie)

---

Top Contributors

[![Drew-Kimberly](https://avatars.githubusercontent.com/u/11247544?v=4)](https://github.com/Drew-Kimberly "Drew-Kimberly (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/drewkimberly-php-dtos/health.svg)

```
[![Health](https://phpackages.com/badges/drewkimberly-php-dtos/health.svg)](https://phpackages.com/packages/drewkimberly-php-dtos)
```

###  Alternatives

[jonaspardon/laravel-event-visualizer

Laravel package to visualize events with their handlers, including jobs to chain them together

2644.9k](/packages/jonaspardon-laravel-event-visualizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
