PHPackages                             matephp/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. [API Development](/categories/api)
4. /
5. matephp/dto

ActiveLibrary[API Development](/categories/api)

matephp/dto
===========

MatePHP - DTO - Simple Data Transfer Objects (DTO) for any framework

2.0.0(2mo ago)044MITPHPPHP ^8.4CI passing

Since Mar 7Pushed 3w agoCompare

[ Source](https://github.com/mate-php/dto)[ Packagist](https://packagist.org/packages/matephp/dto)[ RSS](/packages/matephp-dto/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (8)Versions (12)Used By (0)

 [![Mate/dto Logo](docs/assets/mate-logo.png)](docs/assets/mate-logo.png)

Mate/dto
========

[](#matedto)

 **High-performance, modern and framework-agnostic DTO library for PHP 8.4+.**

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/mate-php/dto)[![Latest Stable Version](https://camo.githubusercontent.com/52c0775d2517308067777e6ece47fb55daa672be73e802941e5d12ebd118888e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6174657068702f64746f)](https://packagist.org/packages/matephp/dto)[![Unstable Version](https://camo.githubusercontent.com/6bb7c46af27d034e3c4de06b6b6720e33e4c35979a232bdbfd6b9c9dfbdd2b12/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f756e737461626c652d6465762d2d6d61696e2d6f72616e6765)](https://github.com/mate-php/dto)[![PHP Version](https://camo.githubusercontent.com/64ba2923d7f4a3d97dba32f6e0cc262b39156b50255c03fe6e8884f8fae754a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e342532422d696e6469676f2e737667)](https://github.com/mate-php/dto/blob/main/composer.json)[![Total Downloads](https://camo.githubusercontent.com/4ed360a08b846ddb8330a064031710691a116b76f368f8c9e1d6e8c2396a6996/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6174657068702f64746f)](https://packagist.org/packages/matephp/dto)[![License](https://camo.githubusercontent.com/16b61692b21d08ee5b57f5937c72c00ef44a58aed83056ebe698c34bdb239848/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6174657068702f64746f)](https://github.com/mate-php/dto/blob/main/LICENSE)[![Hits-of-Code](https://camo.githubusercontent.com/c56177ce617a1e622ae2d938a940248901f9e6d47da386cff7615f1dc1284e1a/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f6d6174652d7068702f64746f3f6272616e63683d6d61696e)](https://hitsofcode.com/github/mate-php/dto/json?branch=main)[![Coverage](https://camo.githubusercontent.com/af813ae002de8e31bfd234a3d5eab4fe1963ed998df54d1f3c5e3e1fe334f7d6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d677265656e2e737667)](https://github.com/mate-php/dto/tree/main/tests)

---

🚀 Overview
----------

[](#-overview)

**Mate/dto** is a lightweight, zero-dependency (almost) core component designed to be **completely framework-agnostic**. It leverages modern PHP 8.4 features like **Asymmetric Visibility** and **Constructor Property Promotion** to provide a developer-friendly API with maximum performance.

📦 Installation
--------------

[](#-installation)

Install the library via Composer:

```
composer require mate-php/dto
```

📖 Quick Start
-------------

[](#-quick-start)

Define your DTO using standard PHP properties and asymmetric visibility for better encapsulation:

```
use Mate\Dto\Dto;

class UserDto extends Dto
{
    public private(set) string $name;
    public private(set) int $age;
    public ?string $email = null;
}

// Instantiate from an array
$user = new UserDto([
    'name' => 'John Doe',
    'age' => 30,
    'email' => 'john.doe@example.com'
]);

echo $user->name; // John Doe
echo $user->toJson();
```

📚 Full Documentation
--------------------

[](#-full-documentation)

For advanced features like **Collections**, **Custom Mapping**, **Strict Mode**, and **Benchmarks**, please visit our full documentation site:

👉 ****

---

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on our development workflow and commit message standards.

---

Made with ❤️ by the **MatePHP** Team.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance91

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~81 days

Total

10

Last Release

69d ago

Major Versions

1.3.3 → 2.0.02026-04-14

PHP version history (3 changes)1.0.0PHP ^8.3

1.3.0PHP ^8.2

2.0.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202171770?v=4)[Federico Lozada Mosto](/maintainers/mostofede)[@mostofede](https://github.com/mostofede)

---

Top Contributors

[![mostofede](https://avatars.githubusercontent.com/u/202171770?v=4)](https://github.com/mostofede "mostofede (14 commits)")

---

Tags

apimapperdata-transfer-objectrestfuldtodata model

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[phpexperts/simple-dto

A quick and easy DTO package.

501.1M7](/packages/phpexperts-simple-dto)[rekalogika/mapper

An object mapper for PHP and Symfony. Maps an object to another object. Primarily used for transforming an entity to a DTO and vice versa.

3850.9k1](/packages/rekalogika-mapper)[artyuum/request-dto-mapper-bundle

This bundle provides an easy way to automatically map the incoming request data to a DTO and optionally validate it.

516.0k](/packages/artyuum-request-dto-mapper-bundle)[teepluss/api

Laravel 4 Internal Request (HMVC)

7034.1k](/packages/teepluss-api)[orisai/object-mapper

Raw data mapping to validated objects

1133.6k2](/packages/orisai-object-mapper)

PHPackages © 2026

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