PHPackages                             zawiszaty/auto-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. zawiszaty/auto-dto

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

zawiszaty/auto-dto
==================

Autogenerate DTO from class

v3.0.0(6y ago)145PHP

Since Aug 4Pushed 6y ago2 watchersCompare

[ Source](https://github.com/zawiszaty/auto-dto)[ Packagist](https://packagist.org/packages/zawiszaty/auto-dto)[ RSS](/packages/zawiszaty-auto-dto/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

AUTO DTO
========

[](#auto-dto)

[![CircleCI](https://camo.githubusercontent.com/7318885967ee64ff96e9824540e7086b0590e20895760cd1a7f4b875e4811c54/68747470733a2f2f636972636c6563692e636f6d2f67682f7a617769737a6174792f6175746f2d64746f2f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/zawiszaty/auto-dto/tree/master)

### Generate DTO from class

[](#generate-dto-from-class)

#### Example

[](#example)

```
class FakeObjectDTO extends ObjectDTO
{
    public function __construct(object $class)
    {
        parent::__construct($class,FakeClass::class);
    }
}
/// OR
class FakeArrayDTO extends ArrayDTO
{
    public function __construct(array $params)
    {
        parent::__construct($params, FakeClass::class);
    }
}
```

##### How to Use

[](#how-to-use)

```
$dateTime = new \DateTime();
$fakeClass = new FakeClass(1, 'test', $dateTime);
$fakeDTO = new FakeObjectDTO($fakeClass);

$this->assertSame(1, $fakeDTO->id);
$this->assertSame('test', $fakeDTO->name);
$this->assertSame($dateTime, $fakeDTO->createdAt);

/// OR

$dateTime = new \DateTime();
$fakeDTO = new FakeArrayDTO([
    'id' => 1,
    'name' => 'test',
    'createdAt' => $dateTime
]);
$this->assertSame(1, $fakeDTO->id);
$this->assertSame('test', $fakeDTO->name);
$this->assertSame($dateTime, $fakeDTO->createdAt);
```

And class have the same properties with base class and the same properties value

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

Total

3

Last Release

2521d ago

Major Versions

v1.0.0 → v2.0.02019-08-04

v2.0.0 → v3.0.02019-08-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20543584?v=4)[Szymon Ciompała](/maintainers/zawiszaty)[@zawiszaty](https://github.com/zawiszaty)

---

Top Contributors

[![zawiszaty](https://avatars.githubusercontent.com/u/20543584?v=4)](https://github.com/zawiszaty "zawiszaty (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[zoha/laravel-meta

a package for working with models meta

236129.6k](/packages/zoha-laravel-meta)[instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

491.4M4](/packages/instasent-sms-counter-php)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26402.1k8](/packages/sylius-taxonomy-bundle)[stidges/country-flags

A small package to convert a country code to the corresponding country flag emoji

29267.7k4](/packages/stidges-country-flags)

PHPackages © 2026

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