makomweb / tactix
Tooling for tactical domain driven design
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/makomweb/tactix
Requires
- php: ^8.2
- nikic/php-parser: ^5.7
- xmolecules/phpmolecules: ^0.2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.92
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.5
This package is auto-updated.
Last update: 2026-01-15 13:08:24 UTC
README
Tactical DDD, simplified for PHP: tag your classes (via PHP attributes) and validate missing tags + forbidden relations.
Installation
composer require --dev makomweb/tactix
Requirements:
- PHP ^8.2
- your source code being tagged with PHP Molecules
Usage
1. Tag your classes
- install the tags package from PHP Molecules as a regular dependeny via:
composer require xmolecules/phpmolecules
- tag your classes with the available attributes:
use PHPMolecules\DDD\Attribute\AggregateRoot; use PHPMolecules\DDD\Attribute\Entity; use PHPMolecules\DDD\Attribute\ValueObject; use PHPMolecules\DDD\Attribute\Service; use PHPMolecules\DDD\Attribute\Factory; use PHPMolecules\DDD\Attribute\Repository; #[Entity] final class User {}
2. Check your classes or folders
use Tactix\Check; Check::className(User::class); Check::folder(__DIR__.'/src');
Check throws on violations:
Tactix\ClassViolationExceptionTactix\FolderViolationException
Both exceptions contain a $violations property of type array<Tactix\Violation> to get further details about wether there are missing tags, ambiguity or forbidden relations.
Forbidden relations
Tactix includes a small built-in blacklist (see Tactix\Forbidden) and reports violations as:
(MyValueObject)-[consumes]->(MyEntity) is a forbidden relation! ❌
