PHPackages                             pilsniak/proophgen - 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. pilsniak/proophgen

ActiveApplication

pilsniak/proophgen
==================

0.1.11(8y ago)86[2 issues](https://github.com/mmp4k/proophgen/issues)BSD-3-ClausePHPPHP ^7.1

Since Oct 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mmp4k/proophgen)[ Packagist](https://packagist.org/packages/pilsniak/proophgen)[ Docs](https://pilsniak.com)[ RSS](/packages/pilsniak-proophgen/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (8)Versions (12)Used By (0)

[proophgen](https://pilsniak.com/proophgen/)
============================================

[](#proophgen)

![GitHub (Pre-)Release Date](https://camo.githubusercontent.com/c80f89f055d247a2365ca9fe2d521f227ca893220f2f580d999e644aaf7046ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652d7072652f6d6d70346b2f70726f6f706867656e2e7376673f7374796c653d666c61742d737175617265)![Travis](https://camo.githubusercontent.com/1cdfd928ea220f8fc42f672b3a800a1d622d1179e5a60d31f1c860959a7c8e6c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6d70346b2f70726f6f706867656e2e7376673f7374796c653d666c61742d737175617265)![Coveralls github](https://camo.githubusercontent.com/e07a04c057a24275ea10561756b4671f72bb5583006b0e8afb5bc70ef97e4abe/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f6d6d70346b2f70726f6f706867656e2e7376673f7374796c653d666c61742d737175617265)![Packagist](https://camo.githubusercontent.com/a12de66a2b53f1755d4ad09e0a22238310a352715de1eba555b45bb9bd17a8cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70696c736e69616b2f70726f6f706867656e2e7376673f7374796c653d666c61742d737175617265)![GitHub release](https://camo.githubusercontent.com/eff46925e573fc811e5daddea89148c0ca7fc14d6fb59938969c23e390d26dfe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d6d70346b2f70726f6f706867656e2f616c6c2e7376673f7374796c653d666c61742d737175617265)![Packagist](https://camo.githubusercontent.com/c9dd45facb148855d1da8b7c1267f2d679720e4b280931ff7f0fc6931b5ecfd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70696c736e69616b2f70726f6f706867656e2e7376673f7374796c653d666c61742d737175617265)![GitHub last commit](https://camo.githubusercontent.com/c3e899179c4e2bca7f7f8a533a97b11af9334e672409e645c81571e186146ac5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6d6d70346b2f70726f6f706867656e2e7376673f7374796c653d666c61742d737175617265)

Why developers love CRUD? Because it's easy to automate work around it. Why developers hate DDD/CQRS? Boilerplates.

Using this small app `proophgen` and single 15th lines `yaml` file you can generate a project that contains **48 files** (with phpspec tests!) and start coding. No more boilerplates.

You can also use singe command to create your ValueObject, Command and AggregateRoot with Events.

Table of Contents
-----------------

[](#table-of-contents)

- [Examples](#examples)
- [Create single ValueObject](#create-single-valueobject)
- [Create single Command](#create-single-command)
- [Create single AggregateRoot with Events](#create-single-aggregateroot-with-events)
- [Id Policy](#id-policy)
- [Installation](#installation)

Examples
--------

[](#examples)

This is your `yaml`

```
idPolicy: Ramsey\Uuid\UuidInterface # or string (default value)
valueObjects:
  - Model\ValueObject\Mail
  - Model\ValueObject\Name
  - Model\ValueObject\Password
commands:
  - Model\Command\RegisterUser
  - Model\Command\LoginUser
aggregateRoots:
  Model\User:
    - !UserRegistered
  Model\Identity:
    - !EmailIdentityCreated
    - UserToIdentityAssigned
    - UserLogged

```

There is your command to run:

```
$ proophgen do

```

And there is your result (since v0.1.10):

```
./src/Infrastructure/Identity/EventSourced.php                                                                                                      ✔  2042  21:06:28
./src/Infrastructure/Identity/InMemory.php
./src/Infrastructure/User/EventSourced.php
./src/Infrastructure/User/InMemory.php
./src/Model/Command/LoginUser.php
./src/Model/Command/RegisterUser.php
./src/Model/CommandHandler/LoginUserHandler.php
./src/Model/CommandHandler/RegisterUserHandler.php
./src/Model/Identity/Event/EmailIdentityCreated.php
./src/Model/Identity/Event/UserLogged.php
./src/Model/Identity/Event/UserToIdentityAssigned.php
./src/Model/Identity/Exception/IdentityNotFound.php
./src/Model/Identity/Guard/EmailIdentityCreatedGuard.php
./src/Model/Identity/Guard/UserLoggedGuard.php
./src/Model/Identity/Guard/UserToIdentityAssignedGuard.php
./src/Model/Identity.php
./src/Model/IdentityRepository.php
./src/Model/User/Event/UserRegistered.php
./src/Model/User/Exception/UserNotFound.php
./src/Model/User/Guard/UserRegisteredGuard.php
./src/Model/User.php
./src/Model/UserRepository.php
./src/Model/ValueObject/Mail.php
./src/Model/ValueObject/Name.php
./src/Model/ValueObject/Password.php
./spec/Infrastructure/Identity/EventSourcedSpec.php
./spec/Infrastructure/Identity/InMemorySpec.php
./spec/Infrastructure/User/EventSourcedSpec.php
./spec/Infrastructure/User/InMemorySpec.php
./spec/Model/Command/LoginUserSpec.php
./spec/Model/Command/RegisterUserSpec.php
./spec/Model/CommandHandler/LoginUserHandlerSpec.php
./spec/Model/CommandHandler/RegisterUserHandlerSpec.php
./spec/Model/Identity/Event/EmailIdentityCreatedSpec.php
./spec/Model/Identity/Event/UserLoggedSpec.php
./spec/Model/Identity/Event/UserToIdentityAssignedSpec.php
./spec/Model/Identity/Exception/IdentityNotFoundSpec.php
./spec/Model/Identity/Guard/EmailIdentityCreatedGuardSpec.php
./spec/Model/Identity/Guard/UserLoggedGuardSpec.php
./spec/Model/Identity/Guard/UserToIdentityAssignedGuardSpec.php
./spec/Model/IdentitySpec.php
./spec/Model/User/Event/UserRegisteredSpec.php
./spec/Model/User/Exception/UserNotFoundSpec.php
./spec/Model/User/Guard/UserRegisteredGuardSpec.php
./spec/Model/UserSpec.php
./spec/Model/ValueObject/MailSpec.php
./spec/Model/ValueObject/NameSpec.php
./spec/Model/ValueObject/PasswordSpec.php

```

Create single ValueObject
-------------------------

[](#create-single-valueobject)

You need to run that command:

```
proophgen vo Model/ValueObject/FirstName

```

As a result you should to see something similar to:

```
Creating files:
[v] ./src/Model/ValueObject/FirstName.php
[v] ./spec/Model/ValueObject/FirstNameSpec.php

```

Create single Command
---------------------

[](#create-single-command)

You need to run that command:

```
proophgen c Model/Command/RemoveUser

```

As a result you should to see something similar to:

```
Creating files:
[v] ./src/Model/Command/RemoveUser.php
[v] ./src/Model/CommandHandler/RemoveUserHandler.php
[v] ./spec/Model/Command/RemoveUserSpec.php
[v] ./spec/Model/CommandHandler/RemoveUserHandlerSpec.php

```

Create single AggregateRoot with Events
---------------------------------------

[](#create-single-aggregateroot-with-events)

You need to run that command:

```
proophgen ar Model/Admin \!AdminCreated AdminRemoved AdminBlocked

```

As a result you should to see something similar to:

```
Creating files:
[v] ./src/Model/Admin.php
[v] ./src/Model/AdminRepository.php
[v] ./src/Model/Admin/Exception/AdminNotFound.php
[v] ./src/Model/Admin/Event/AdminCreated.php
[v] ./src/Model/Admin/Guard/AdminCreatedGuard.php
[v] ./src/Model/Admin/Event/AdminRemoved.php
[v] ./src/Model/Admin/Guard/AdminRemovedGuard.php
[v] ./src/Model/Admin/Event/AdminBlocked.php
[v] ./src/Model/Admin/Guard/AdminBlockedGuard.php
[v] ./src/Infrastructure/Admin/InMemory.php
[v] ./src/Infrastructure/Admin/EventSourced.php
[v] ./spec/Model/AdminSpec.php
[v] ./spec/Infrastructure/Admin/EventSourcedSpec.php
[v] ./spec/Model/Admin/Exception/AdminNotFoundSpec.php
[v] ./spec/Infrastructure/Admin/InMemorySpec.php
[v] ./spec/Model/Admin/Event/AdminCreatedSpec.php
[v] ./spec/Model/Admin/Guard/AdminCreatedGuardSpec.php
[v] ./spec/Model/Admin/Event/AdminRemovedSpec.php
[v] ./spec/Model/Admin/Guard/AdminRemovedGuardSpec.php
[v] ./spec/Model/Admin/Event/AdminBlockedSpec.php
[v] ./spec/Model/Admin/Guard/AdminBlockedGuardSpec.php

```

Id Policy
---------

[](#id-policy)

As default `proophgen` generates all ids as string. If you wish you can change it just running this variant of previous commands:

For aggregate root:

```
proophgen ar --id-policy="Ramsey\Uuid\UuidInterface" Model/Admin \!AdminCreated AdminRemoved AdminBlocked

```

For command:

```
proophgen c --id-policy="Ramsey\Uuid\UuidInterface" Model/Command/RemoveUser

```

Installation
------------

[](#installation)

There is a few way to use `proophgen`

### 1. You can download .phar file

[](#1-you-can-download-phar-file)

Go to [releases page on github](https://github.com/mmp4k/proophgen/releases) and download `proophgen.phar`.

```
mv ~/Downloads/proophgen.phar /usr/local/bin/proophgen
chmod +x /usr/local/bin/proophgen

```

### 2. You can use docker

[](#2-you-can-use-docker)

Just run that command:

```
docker run -v $(pwd):/var/www proophgen/proophgen

```

### 3. Composer (not recommended)

[](#3-composer-not-recommended)

You can add `proophgen` directly to your project as `dev` dependency but then your project and `proophgen` will be sharing a whole dependencies and some conflicts can happened.

```
composer require --dev pilsniak/proophgen

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Every ~1 days

Total

11

Last Release

3108d ago

### Community

Maintainers

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

---

Top Contributors

[![mmp4k](https://avatars.githubusercontent.com/u/7452430?v=4)](https://github.com/mmp4k "mmp4k (28 commits)")

---

Tags

boilerplate-generatorcqrscqrs-esphpphpspecprooph

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/pilsniak-proophgen/health.svg)

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[laravel/vapor-cli

The Laravel Vapor CLI

31310.7M8](/packages/laravel-vapor-cli)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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