PHPackages                             yago-o/simple-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. yago-o/simple-dto

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

yago-o/simple-dto
=================

Simple class for build php dto objects via PHPDoc annotations.

1.0.4(7y ago)410.9k↓42.9%2MITPHPPHP ~7.1

Since Oct 8Pushed 7y ago2 watchersCompare

[ Source](https://github.com/YagO-o/simple-dto)[ Packagist](https://packagist.org/packages/yago-o/simple-dto)[ RSS](/packages/yago-o-simple-dto/feed)WikiDiscussions master Synced 3w ago

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

Simple Dto
----------

[](#simple-dto)

This is class for building simple DTO objects via PHPDoc annotations. Includes scalar, array and type validation.

### Example:

[](#example)

```
class DtoClass extends SimpleDto
{
    /** @var integer */
    private $id;

    /** @var string|null */
    private $name;

    /** @var int[] */
    private $idList;

    /** @var TypeClass */
    private $typeClass;

    /** @var float */
    private $rating = 3.5;

    /** @var bool */
    private $isAdmin = false;

    /**
     * @return int
     */
    public function getId(): int
    {
        return $this->id;
    }

    /**
     * @return null|string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return int[]
     */
    public function getIdList(): array
    {
        return $this->idList;
    }

    /**
     * @return TypeClass
     */
    public function getTypeClass(): TypeClass
    {
        return $this->typeClass;
    }

    /**
     * @return float
     */
    public function getRating(): float
    {
        return $this->rating;
    }

    /**
     * @return bool
     */
    public function isAdmin(): bool
    {
        return $this->isAdmin;
    }
}

class TypeClass
{
}

$dto = new DtoClass([
    'id' => 5,
    'name' => 'Ivan',
    'idList' => [1,2,3,4,5],
    'typeClass' => new TypeClass(),
    'isAdmin' => true,
]);

$id = $dto->getId(); // 5
$name = $dto->getName(); // 'Ivan'
$idList = $dto->getIdList(); // [1,2,3,4,5]
$rating = $dto->getRating(); // 3.5
$typeClass = $dto->getTypeClass(); // TypeClass object
$isAdmin = $dto->isAdmin(); // true
```

### Installation:

[](#installation)

```
composer require yago-o/simple-dto

```

### Caveats:

[](#caveats)

- All types may be arrayable.
- All class properties must be described via PHPDoc annotation.
- To use custom classes on properties you must write full class name include namespace.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

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

Total

6

Last Release

2722d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/971c7900a687abe511160d0d881c3e6258abc254102e0c691aa5393649de98d7?d=identicon)[YagO-o](/maintainers/YagO-o)

---

Top Contributors

[![YagO-o](https://avatars.githubusercontent.com/u/5960113?v=4)](https://github.com/YagO-o "YagO-o (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yago-o-simple-dto/health.svg)

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

###  Alternatives

[shapecode/hidden-entity-type-bundle

Hidden field for Symfony entities

28441.3k1](/packages/shapecode-hidden-entity-type-bundle)[dxw/phar-install

20161.8k4](/packages/dxw-phar-install)[dotswan/filament-code-editor

2386.6k1](/packages/dotswan-filament-code-editor)[rapidwebltd/array_undot

array\_undot (the opposite of the array\_dot helper function) expands a dot notation array into a full multi-dimensional array.

1514.0k2](/packages/rapidwebltd-array-undot)

PHPackages © 2026

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