Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Tests

on: [push]

jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
- name: PHPUnit Tests
uses: php-actions/phpunit@v9
with:
configuration: tests/phpunit.xml
5 changes: 4 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude(['var', 'vendor', 'migrations', 'fixtures'])
->exclude([
'src/Resources/skeleton',
'vendor'
])
->in(__DIR__)
;

Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,36 @@ class Logger extends Facade
```

Although facades are better testable than regular singletons, it is highly recommended to only use them sparringly and always prefer normal dependency injection when possible.

## Generator Commands

This bundle adds several [maker bundle](https://symfony.com/bundles/SymfonyMakerBundle/current/index.html) commands to generate commonly used components.

### Model / Repository

This command can be used to generate:

- The domain model class.
- A repository class for the model.
- The model's identity class as value object (optional).
- A Doctrine database entity configuration, either as annotation or separate config file (optional).
- A custom Doctrine type for the model's identity class (optional).

#### Command Output

```bash
Description:
Creates a new domain model class

Usage:
make:ddd:model [options] [--] [<name>]

Arguments:
name The name of the model class (e.g. Customer)

Options:
--aggregate-root Marks the model as aggregate root
--entity=ENTITY Use this model as Doctrine entity
--with-identity=WITH-IDENTITY Whether an identity value object should be created
--with-suffix Adds the suffix "Model" to the model class name
```
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"autoload": {
"psr-4": {
"GeekCell\\DddBundle\\": "src"
"GeekCell\\DddBundle\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -36,12 +36,13 @@
"mockery/mockery": "^1.5",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-mockery": "^1.1",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.5",
"symfony/maker-bundle": "^1.48"
},
"scripts": {
"gc:tests": "phpunit --testdox --colors=always",
"gc:cs-lint": "php-cs-fixer fix --config .php-cs-fixer.php --diff -vvv --dry-run",
"gc:cs-fix": "php-cs-fixer fix --config .php-cs-fixer.php -vvv || true",
"gc:phpstan": "phpstan analyse --memory-limit=2G --no-progress --level=8"
}
}
}
Loading