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

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

guanhui07/dto
=============

dto,entity

1.0.0(1y ago)13MITPHPPHP &gt;7.0

Since Sep 29Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

dto
---

[](#dto)

```
composer require guanhui07/dto dev-main
```

定义dto类
------

[](#定义dto类)

```
namespace App\Services\Entity;
use Guanhui07\BaseDto;

class MsgGiftDto extends BaseDto
{

    /**
     * 礼物ID
     * @var int
     */
    public $id;

    /**
     * 礼物数量
     * @var int
     */
    public $number;

   /**
     * 礼物名
     * @var int
     */
    public $gift_name;

}
```

使用dto 传参 方式1
------------

[](#使用dto-传参--方式1)

```
$giftDto = new MsgGiftDto([
    'id' => 1,
    'number' => 10,
    'gift_name' => 'test123',
])

$obj->send($giftDto);
```

使用dto 传参 方式2
------------

[](#使用dto-传参--方式2)

```
$giftDto = new MsgGiftDto()->fill([
    'id' => 1,
    'number' => 10,
    'gift_name' => 'test123',
]);

$obj->send($giftDto);
```

使用dto 传参 方式3
------------

[](#使用dto-传参--方式3)

```
$giftDto = new MsgGiftDto();
$giftDto->id = 1;
$giftDto->number = 10;
$giftDto->gift_name = 'test123';

$obj->send($giftDto);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

591d ago

### Community

Maintainers

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

---

Top Contributors

[![guanhui07](https://avatars.githubusercontent.com/u/5820457?v=4)](https://github.com/guanhui07 "guanhui07 (8 commits)")

---

Tags

dtoentity

### Embed Badge

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

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

###  Alternatives

[askvortsov/flarum-auto-moderator

Powerful automation engine.

1418.4k2](/packages/askvortsov-flarum-auto-moderator)

PHPackages © 2026

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