PHPackages                             becklyn/ddd-generator-bundle - 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. becklyn/ddd-generator-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

becklyn/ddd-generator-bundle
============================

Code generator for common Domain Driven Design patterns in the Becklyn DDD framework.

2.2.1(4y ago)04.9k↓71.4%[1 issues](https://github.com/Becklyn/ddd-generator-bundle/issues)MITPHP

Since Aug 10Pushed 4y agoCompare

[ Source](https://github.com/Becklyn/ddd-generator-bundle)[ Packagist](https://packagist.org/packages/becklyn/ddd-generator-bundle)[ RSS](/packages/becklyn-ddd-generator-bundle/feed)WikiDiscussions 1.x Synced 3d ago

READMEChangelog (10)Dependencies (14)Versions (13)Used By (0)

DDD Generator Bundle
====================

[](#ddd-generator-bundle)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
 composer require becklyn/ddd-generator-bundle --dev
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
  composer require becklyn/ddd-generator-bundle --dev
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Becklyn\DddGeneratorBundle\BecklynDddGeneratorBundle::class => ['dev' => true],
];
```

Creating your own Generator/Maker
---------------------------------

[](#creating-your-own-generatormaker)

If you want to create your own Generator based on the DddMaker you'll need to extend either of the abstract Maker classes.

Be sure not to extend a non-abstract class unless you can ensure that their implementation will never change.

If you can't ensure that it would be a better idea to use one of the following:

- DddMaker: The most general abstraction. In only provides functionality without having a base implementation.
- DddEntityMaker: This is the easiest to use for implementing a generator based on some input options. In fact most generator of this bundle use the DddEntityMaker.
- DddEntityTestMaker: A specialized DddEntityMaker for generating Test files.
- DddEntityCommandMaker: A specialized DddEntityMaker for generating Command and CommandHandler classes.

All you need to do to generate your own Generator is to create a class, that extends a Maker in `src/Maker` and to create a template file.

The template file may be placed in `res/skeleton/ddd` or `src/Resources/skeleton/ddd` and use the file extension `.tpl.php`. If you cannot place the templates there you can also override the Makers `getTemplatePath()`.

Refer to the Templating section for more information about how to create templates.

Lastly you need to register your Maker as a Maker in your service configuration file.
This is done by providing the `maker.command` tag to the service.

A word about i18n
-----------------

[](#a-word-about-i18n)

If you want to use the localization feature you should provide it using the `getExtraVariables()` method and use as `$extra` in the template.

Alternatively you can override the `internationalize()` method, but you'll need to provide any key the bundle defines internally to continue to use the pre-defined features. Because these keys can change between every patch version it could be very hard for you to ensure that no functionality breaks.

Templating
----------

[](#templating)

The template files itself are plain text files that get php variables injected using
``.

If you're using the `DddEntityMaker` or a class that extends it you can use the following variables:

- `$domain_namespace`: The Sub-Namespace of the Domain. E.g. `\App\Authorization\Domain\Foo` in this Namespace `Foo` would be the Sub-Namespace. This is a can also be multi-level e.g. `Foo\Bar`
- `$entity`: Name of the Entity that should be generated. E.g. `User
- `$domain`:Name of the Domain that everything should be created in. E.g. `Authorization`
- `$psr4Root`: The Name of the PSR-4 Root as defined by Composer.
- `$i18n`: A array of i18n strings. The available keys are stored inside yaml files located at `src/Resources/i18n`. This array should only be used for internal makers e.g. if you want to make a PR to this bundle. Please refer to the i18n section.
- `$version`: The current date formatted as `YYYY-MM-DD`. This is used to auto-generate PHP-doc comments
- `$author`: The current git user formatted as `USERNAME ` or `Code Generator ` if the git user can not be read.
- `$extra`: A array that can be used to provide any information that is needed.

NOTE: If you override `getExtraVariables()` be sure to merge your array with the array of `super()` to ensure that nothing breaks.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.9% 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 ~15 days

Recently: every ~24 days

Total

12

Last Release

1629d ago

Major Versions

1.0.0 → 2.0.12021-08-10

1.0.1 → 2.0.22021-08-20

1.x-dev → 2.2.02021-10-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1044355?v=4)[Becklyn Studios](/maintainers/becklyn)[@Becklyn](https://github.com/Becklyn)

---

Top Contributors

[![glassp](https://avatars.githubusercontent.com/u/24590561?v=4)](https://github.com/glassp "glassp (45 commits)")[![msvujnovic-becklyn](https://avatars.githubusercontent.com/u/74408165?v=4)](https://github.com/msvujnovic-becklyn "msvujnovic-becklyn (9 commits)")[![msvujnovic](https://avatars.githubusercontent.com/u/22997161?v=4)](https://github.com/msvujnovic "msvujnovic (2 commits)")[![oechsler](https://avatars.githubusercontent.com/u/17933752?v=4)](https://github.com/oechsler "oechsler (1 commits)")

---

Tags

code-generationcode-generatordddddd-architecturephpsymfonysymfony-bundleDomain Driven Designdddcode-generation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/becklyn-ddd-generator-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/becklyn-ddd-generator-bundle/health.svg)](https://phpackages.com/packages/becklyn-ddd-generator-bundle)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[illuminate/process

The Illuminate Process package.

44869.2k99](/packages/illuminate-process)[phpmentors/domain-kata

Kata for domain models

73448.1k9](/packages/phpmentors-domain-kata)[thejano/laravel-domain-driven-design

Helps to use domain driven design within laravel

15425.2k](/packages/thejano-laravel-domain-driven-design)

PHPackages © 2026

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