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

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

bermudaphp/dto-factory
======================

v2.0.1(1y ago)120MITPHPPHP ^8.3

Since Mar 11Pushed 1y agoCompare

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

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

Install
=======

[](#install)

```
composer require bermudaphp/dto-factory
```

Usage
=====

[](#usage)

```
readonly class CreatePostData
{
    public function __construct(
        public string                          $title,
        #[From('title', true)]
        #[Cast(Slugify::class)]
        public string                          $slug,
        #[Cast('json')]
        public array                           $content,
        public UserReference|User              $author,
        #[From('categoryId')]
        #[Cast([CategoryReference::class, 'fromId'])]
        public null|CategoryReference|Category $category,
        #[Cast([TagsCollection::class, 'fromJsonString'])]
        #[Defaults(null)]
        public readonly ?iterable $tags,
        #[Cast('json')]
        public ?array                          $metadata,
        #[Cast(Boolean::class)]
        #[Defaults(true)]
        public bool                            $commentable,
        #[Defaults(false)]
        public bool                            $pinned,
        #[Invoke('now')]
        public CarbonInterface                 $createdAt,
        #[Cast([Clock::class, 'create'])]
        public ?CarbonInterface                $publishedAt = null,
        public ?CarbonInterface                $updatedAt = null,
        public ?CarbonInterface                $deletedAt = null,
    ) {
    }
}

$factory = new ObjectFactory;

$dto = factory->make(CreatePostData::class, [
  'title' => 'My First Post',
  'content' => 'valid json string',
  'author' => new User(1),
  'categoryId' => 2
], true)
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance46

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

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

Recently: every ~180 days

Total

7

Last Release

405d ago

Major Versions

v1.2.1 → v2.02024-07-26

PHP version history (2 changes)v1.0PHP ^8.1

v2.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (72 commits)")

### Embed Badge

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

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

###  Alternatives

[sonata-project/classification-bundle

Symfony SonataClassificationBundle

913.2M20](/packages/sonata-project-classification-bundle)[tga/simhash-php

SimHash similarities algorithm implementation for PHP 5.3

15243.5k1](/packages/tga-simhash-php)[ttree/contentrepositoryimporter

Helper package to import data in the Neos content repository

1510.2k](/packages/ttree-contentrepositoryimporter)[cinghie/yii2-traits

Yii2 Traits

116.9k8](/packages/cinghie-yii2-traits)

PHPackages © 2026

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