Building blocks for modular architecture with Symfony.
Provides DDD-oriented abstractions ─ commands, queries, domain events, error handling, collections, and a convention-based module system ─ so you can focus on your domain logic instead of wiring infrastructure.
composer require open-solid/coreThe bundle is auto-registered via Symfony Flex.
Each bounded context lives in its own module with the same layered structure:
src/
├── Product/ # Module root
│ ├── Application/
│ │ └── Product/ # Aggregate
│ │ ├── Create/ # Use case (verb)
│ │ │ ├── CreateProduct.php # Command
│ │ │ └── CreateProductHandler.php # Handler
│ │ └── Find/
│ │ ├── FindProduct.php # Query
│ │ └── FindProductHandler.php # Handler
│ ├── Domain/
│ │ ├── Error/ # Domain-specific errors
│ │ ├── Event/ # Domain events
│ │ └── Model/ # Aggregate, entities and value objects
│ │ └── Product.php
│ └── Infrastructure/
│ ├── Resources/
│ │ └── config/
│ │ ├── doctrine/
│ │ │ └── mapping/ # Doctrine ORM mappings
│ │ ├── packages/ # Package-specific config overrides
│ │ └── services.yaml # Service definitions
│ └── ProductExtension.php # Module extension
│
├── Order/ # Another module
│ ├── Application/
│ ├── Domain/
│ └── Infrastructure/
│ └── OrderExtension.php
│
└── Kernel.phpEach ModuleExtension automatically registers services, and Doctrine mappings for its module ─ zero manual wiring.
- Configuration ─ Bus strategies, Doctrine ORM mapping, and API Platform resource settings.
- Commands & Queries (CQS) ─ Type-safe command-query separation with auto-discovered handlers.
- Domain Events ─ Raise and react to events with automatic publishing after command execution.
- Error Handling ─ Structured domain errors with factory methods and batch error accumulation.
- Collections ─ Domain repository abstractions built on top of Doctrine Collections.
- Modular Architecture ─ Convention-based module system with automatic service registration.