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

ActiveLibrary

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

Data Transfer Object.

1.6.1(2mo ago)01235PHPPHP ^8.1

Since Jun 25Pushed 2mo 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 1mo ago

READMEChangelog (5)Dependencies (2)Versions (12)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

42

—

FairBetter than 90% of packages

Maintenance83

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

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

Recently: every ~39 days

Total

11

Last Release

87d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7564e10ba11b25d8700726a92f669e38be2ff9191e8f6ccdfafc36678ffab2b8?d=identicon)[ali-eltaweel](/maintainers/ali-eltaweel)

---

Top Contributors

[![ali-eltaweel](https://avatars.githubusercontent.com/u/45892756?v=4)](https://github.com/ali-eltaweel "ali-eltaweel (13 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)
```

PHPackages © 2026

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