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

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

mbernet/dto-parser
==================

A DTO Parser to convert array to object magically

v1.0.0(5y ago)0778MITPHPPHP &gt;=7.1

Since Nov 26Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

dto-parser
==========

[](#dto-parser)

Parse simple array data to well defined PHP objects. Very usefull to strict type data before json encoding.

Just extend your DTO object with BaseDTO

Example

```
class SuccessDTO extends BaseDTO {
    public $message;
    public $id;

    /**
     * SuccessDTO constructor.
     *
     * @param $message
     * @param $id
     */
    public function __construct(string $message, $id = null)
    {
        $this->message = $message;
        $this->id = $id;
    }
}
```

Now, in the controller

```
$successObject = SuccessDTO::toDTO(['message' => 'success', 'id' => 23]); //Get instance of SuccessDTO class
```

Alternativelly you can use toDTOArray to parse multiple rows

```
$successes = SuccessDTO::toDTOArray([['message' => 'success', 'id' => 23],['message' => 'error', 'id' => null]]);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

2044d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed512bef43711fdec606eb35b06eeee8149cb615bd8a6ca95e390acc3445ddeb?d=identicon)[mbernet](/maintainers/mbernet)

---

Top Contributors

[![mbernet](https://avatars.githubusercontent.com/u/7669538?v=4)](https://github.com/mbernet "mbernet (5 commits)")

### Embed Badge

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

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

###  Alternatives

[bitbag/wishlist-plugin

Wishlist plugin for Sylius.

69610.4k4](/packages/bitbag-wishlist-plugin)[abhi1693/yii2-sms

Send Free Sms for Yii2

181.9k](/packages/abhi1693-yii2-sms)

PHPackages © 2026

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