adrienlbt / hexagonal-maker-bundle
Hexagonal Maker bundle add commands to Symfony Maker bundle to help you to create files for hexagonal architecture.
Package info
github.com/AdrienWac/maker-hexagonal
Type:symfony-bundle
pkg:composer/adrienlbt/hexagonal-maker-bundle
Requires
- php: >=8.1
- doctrine/dbal: ^4.2
- doctrine/orm: ^3.3
- nikic/php-parser: ^5.4
- symfony/config: ^6.4|^7.0
- symfony/console: ^6.4|^7.0
- symfony/dependency-injection: ^6.4|^7.0
- symfony/framework-bundle: ^6.4|^7.0
- symfony/http-kernel: ^6.4|^7.0
- symfony/maker-bundle: ^1.0@dev
- symfony/process: ^6.4|^7.2
- symfony/yaml: ^6.4|^7.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- rregeer/phpunit-coverage-check: dev-master
- squizlabs/php_codesniffer: 4.0.x-dev
- symfony/maker-bundle: ^1.0@dev
- symfony/phpunit-bridge: ^6.4.1|^7.0
This package is auto-updated.
Last update: 2026-03-03 10:20:27 UTC
README
The Hexagonal Maker Bundle is a code generator for Symfony that automates the use case creation process for Hexagonal Architecture. It extends Symfony's Maker Bundle to generate properly structured use cases, requests, responses, and presenter interfaces.
⚙️ Installation
Add the bundle with composer:
composer require --dev adrienlbt/hexagonal-maker-bundle
If Symfony Flex doesn't add the bundle automatically, activate it manually:
// config/bundles.php return [ // ... AdrienLbt\HexagonalMakerBundle\HexagonalMakerBundle::class => ['dev' => true] ];
That's it! The bundle is now ready to use. No additional configuration steps are required.
⚙️ Configuration (Optional)
You can customize the default paths for your hexagonal architecture layers:
# config/packages/hexagonal_maker.yaml hexagonal_maker: application_path: 'Application' # Default domain_path: 'Domain' # Default infrastructure_path: 'Infrastructure' # Default
📖 Usage
Create Use Case
Run the following command and follow the interactive prompts:
bin/console make:hexagonal:usecase
This will generate:
- UseCase class in
Domain\UseCase\{folder}\{Name} - Request class in
Domain\Request\{folder}\{Name}Request - Response class in
Domain\Response\{folder}\{Name}Response - PresenterInterface in
Domain\API\{folder}\{Name}PresenterInterface
Example
bin/console make:hexagonal:usecase User CreateUser # This generates: # - Domain/UseCase/User/CreateUser.php # - Domain/Request/User/CreateUserRequest.php # - Domain/Response/User/CreateUserResponse.php # - Domain/API/User/CreateUserPresenterInterface.php
🏗️ Generated Structure
The make:hexagonal:usecase command generates the following files:
src/
├── Domain/
│ ├── UseCase/{folder}/ # Use case implementations
│ ├── Request/{folder}/ # Request DTOs
│ ├── Response/{folder}/ # Response DTOs
│ └── API/{folder}/ # Presenter interfaces
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This bundle is released under the MIT License.