PHPackages                             rinsvent/dto2data - 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. rinsvent/dto2data

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

rinsvent/dto2data
=================

Convert data to dto object

v0.0.11(4y ago)02183MITPHPPHP ^8.0

Since Aug 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Rinsvent/dto2data)[ Packagist](https://packagist.org/packages/rinsvent/dto2data)[ RSS](/packages/rinsvent-dto2data/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (12)Used By (3)

[![pipeline status](https://camo.githubusercontent.com/8da933df75f289ac7edc031ae19d11bdbdd8fef8cadd3b025f610f9ea8d8c341/68747470733a2f2f6769742e72696e7376656e742e72752f72696e7376656e742f64746f32646174612f6261646765732f6d61737465722f706970656c696e652e737667)](https://git.rinsvent.ru/rinsvent/dto2data/-/commits/master)[![coverage report](https://camo.githubusercontent.com/deb0357b686791baaef8deae20afcd2e82b796a33518ca225bfa86f6bf598eaa/68747470733a2f2f6769742e72696e7376656e742e72752f72696e7376656e742f64746f32646174612f6261646765732f6d61737465722f636f7665726167652e737667)](https://git.rinsvent.ru/rinsvent/dto2data/-/commits/master)

Dto2data
========

[](#dto2data)

Установка
---------

[](#установка)

```
composer require rinsvent/dto2data
```

Пример
------

[](#пример)

### Описания ДТО

[](#описания-дто)

```
class BuyRequest
{
    public string $phrase;
    public int $length;
    public bool $isFirst;
}

interface BarInterface
{

}

class Bar implements BarInterface
{
    public float $barField;
}

#[HelloSchema]
class HelloRequest
{
    #[Trim]
    public string $surname;
    #[DataPath('fake_age')]
    public int $age;
    public array $emails;
    public array $authors;
    public array $authors2;
    public array $authors3;
    public BuyRequest $buy;
    public BarInterface $bar;
}
```

### Использование

[](#использование)

```
use Rinsvent\DTO2Data\Dto2DataConverter;

$helloRequest = new HelloRequest;
$helloRequest->surname = '   asdf';
$helloRequest->age = 3;
$helloRequest->emails =[
    'sfdgsa',
    'af234f',
    'asdf33333'
];
$author1 = new Author();
$author1->name = 'Tolkien';
$author2 = new Author();
$author2->name = 'Sapkovsky';
$helloRequest->authors = [
    $author1,
    $author2
];
$helloRequest->authors2 = [
    [
        "name" => "Tolkien"
    ],
    [
        "name" => "Sapkovsky"
    ]
];
$helloRequest->authors3 = [
    [
        "name" => "Tolkien"
    ],
    [
        "name" => "Sapkovsky"
    ]
];
$buy = new BuyRequest();
$buy->phrase = 'Buy buy!!!';
$buy->length = 10;
$buy->isFirst = true;
$helloRequest->buy = $buy;
$bar = new Bar();
$bar->barField = 32;
$helloRequest->bar = $bar;

$dto2DataConverter = new Dto2DataConverter();
$dto = $dto2DataConverter->convert($helloRequest);
```

### Результат

[](#результат)

```
$dto = [
    "surname" => "asdf",
    "fake_age" => 3,
    "emails" => [
        "sfdgsa",
        "af234f",
        "asdf33333"
    ],
    "authors" => [
        [
            "name" => "Tolkien"
        ],
        [
            "name" => "Sapkovsky"
        ]
    ],
    "authors2" => [
        [
            "name" => "Tolkien"
        ],
        [
            "name" => "Sapkovsky"
        ]
    ],
    "authors3" => [],
    "buy" => [
        "phrase" => "Buy buy!!!",
        "length" => 10,
        "isFirst" => true
    ],
    "bar" => [
        "barField" => 32
    ]
]
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~22 days

Recently: every ~37 days

Total

11

Last Release

1506d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22261086?v=4)[rinsvent](/maintainers/rinsvent)[@Rinsvent](https://github.com/Rinsvent)

---

Top Contributors

[![rinsvent007](https://avatars.githubusercontent.com/u/183840611?v=4)](https://github.com/rinsvent007 "rinsvent007 (22 commits)")[![sipachev](https://avatars.githubusercontent.com/u/162081332?v=4)](https://github.com/sipachev "sipachev (2 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/rinsvent-dto2data/health.svg)

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

###  Alternatives

[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)

PHPackages © 2026

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