PHPackages                             ali-eltaweel/dto - 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. ali-eltaweel/dto

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

ali-eltaweel/dto
================

Data Transfer Object.

1.7.0(2w ago)01385PHPPHP ^8.1

Since Jun 25Pushed 2w agoCompare

[ Source](https://github.com/ali-eltaweel/dto)[ Packagist](https://packagist.org/packages/ali-eltaweel/dto)[ RSS](/packages/ali-eltaweel-dto/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (4)Versions (13)Used By (5)

DTO
===

[](#dto)

**Data Transfer Object**

- [DTO](#dto)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Object](#object)
        - [Map](#map)
        - [Collection](#collection)

---

Installation
------------

[](#installation)

Install *dto* via Composer:

```
composer require ali-eltaweel/dto
```

Usage
-----

[](#usage)

### Object

[](#object)

Data transfer objects have well defined fields and types.

```
use DTO\DataTransferObject;

class InputDirectory extends DataTransferObject {

  public final function __construct(string $path, float $maxDepth = 32, bool $followSymlinks = true) {

    parent::__construct(func_get_args());
  }
}
```

```
$inputDirectory = InputDirectory::fromArray([ 'path' => '/var/www/html' ]);
```

### Map

[](#map)

Data transfer maps - on the other hands - don't have well defined fields and accept all fields.

```
use DTO\DataTransferMap;

class LookupTable extends DataTransferMap {
}
```

Maps can enforce a type for all fields via the `__v` method:

```
use DTO\DataTransferMap;

class LookupTable extends DataTransferMap {

  function __v(string $field) {}
}
```

### Collection

[](#collection)

Data transfer collections are used to hold multiple data transfer objects.

```
use DTO\DataTransferCollection;

class InputDirectories extends DataTransferCollection {

  function __v(InputDirectory $field) {}
}
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance96

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

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 ~32 days

Recently: every ~69 days

Total

12

Last Release

20d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45892756?v=4)[Ali Kamel](/maintainers/ali-eltaweel)[@ali-eltaweel](https://github.com/ali-eltaweel)

---

Top Contributors

[![ali-eltaweel](https://avatars.githubusercontent.com/u/45892756?v=4)](https://github.com/ali-eltaweel "ali-eltaweel (14 commits)")

### Embed Badge

![Health badge](/badges/ali-eltaweel-dto/health.svg)

```
[![Health](https://phpackages.com/badges/ali-eltaweel-dto/health.svg)](https://phpackages.com/packages/ali-eltaweel-dto)
```

###  Alternatives

[sylvainjule/locator

A map &amp; geolocation field, built on top of open-source services / Mapbox

11240.8k1](/packages/sylvainjule-locator)[data-values/number

Numerical value objects, parsers and formatters

20312.1k14](/packages/data-values-number)[b13/environment

Configure multiple environments for TYPO3

1211.9k](/packages/b13-environment)[kubawerlos/composer-smaller-lock

Plugin to keep composer.lock smaller and readable

136.4k](/packages/kubawerlos-composer-smaller-lock)

PHPackages © 2026

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