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

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

lokus/dto
=========

Package for creating DTOs

1.0.1(9mo ago)01MITPHPPHP &gt;=8.3CI passing

Since Aug 10Pushed 9mo agoCompare

[ Source](https://github.com/Lokusok/lokus-dto)[ Packagist](https://packagist.org/packages/lokus/dto)[ RSS](/packages/lokus-dto/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Package for creating DTOs in type-safe way
==========================================

[](#package-for-creating-dtos-in-type-safe-way)

This package allows you to create DTO from array with providing validation of key names and parameteres of constructor, also validate types of array values.

Installation:

`composer require lokus/dto`

Example of usage:

```
use Lokus\Dto\SimpleDTO;

final readonly class PostDTO extends SimpleDTO
{
    public function __construct(
        public string $title,
        public string $content,
    ) {}
}

$data = [
    'title' => 'Simple Title',
    'content' => 'Simple Content',
];

$dto = PostDTO::fromArray($data);

echo $dto->title;
echo $dto->content;
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance58

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

272d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e5cfee16848c34100d399a42021ccfd266a3d0228cebba0d5f0f18ac53315d5?d=identicon)[Lokusok](/maintainers/Lokusok)

---

Top Contributors

[![Lokusok](https://avatars.githubusercontent.com/u/139644328?v=4)](https://github.com/Lokusok "Lokusok (13 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[rupadana/filament-slider

Slide into Precision – Customizable Control at Your Fingertips.

1221.3k](/packages/rupadana-filament-slider)

PHPackages © 2026

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