bwaidelich/dcb-example-courses
73.5
Strong · 21 September 2026
1.3k
lines of production code
PHP
primary language
4
measurements over time
What this system is
This system is an example implementation of the Dynamic Consistency Boundary pattern, designed to manage courses and students through a command-driven, event-sourced architecture. It processes user commands to update state and publishes domain events, which are then handled by projections to maintain consistent state. The codebase includes domain types, command handlers, and projection logic, all supported by integration tests and static analysis tools.
Features
Added command and domain event classes for course and student management
Introduced a set of command objects (CreateCourse, RegisterStudent, RenameCourse, SubscribeStudentToCourse, UnsubscribeStudentFromCourse, UpdateCourseCapacity) and corresponding domain events (CourseCreated, CourseRenamed, CourseCapacityChanged, StudentRegistered, StudentSubscribedToCourse, StudentUnsubscribedFromCourse) along with their respective interfaces and a DomainEvents collection. These classes define the input structure for user actions and the resulting state changes in the system.
src/Command, src/Event · high confidence
Initial release of the Dynamic Consistency Boundary example
The repository now includes a complete implementation of the Dynamic Consistency Boundary pattern, featuring an example script (index.php) that demonstrates creating and managing courses and students, along with configuration files for testing (phpunit.xml, behat.yml) and static analysis (phpstan.neon.dist).
(repo-wide) · high confidence
Introduce command handling for course and student management
Added the \CommandHandler\ class which processes commands such as creating or renaming courses, registering or unsubscribing students, and updating course capacity. This includes new supporting classes: \DecisionModel\ for state and append conditions, \EventSerializer\ for converting domain events to and from the event store, and a \ConstraintException\ for validation failures.
src · high confidence
Introduce domain value objects for courses and students
Added new domain types in src/Types to enforce type safety and validation for course and student identifiers and attributes. This includes CourseId, StudentId, CourseTitle, CourseCapacity, and a collection wrapper CourseIds. These classes provide structured representations for core entities, enabling more robust handling of course and student data within the application.
src/Types · high confidence
New projection implementations for event handling
Added new projection classes in the src/Projection directory to support event-driven state management. This includes a ClosureProjection for functional-style event handlers, a CompositeProjection to manage multiple projections as a single unit, a TaggedProjection that filters events by tags, and a NullProjection for testing purposes. These classes implement the new Projection interface and StreamCriteriaAware interface, enabling more flexible and composable event processing.
src/Projection · high confidence
Test coverage
Added Behat integration tests for domain commands and PHPStan static analysis support
Added Behat feature files and a FeatureContext to test the behavior of creating courses, registering and managing students, and updating course capacity, ensuring the command handlers and event store interact correctly. Additionally, a PHPStan extension was added to provide static analysis support for the CommandHandler's buildDecisionModel method, improving code quality checks.
tests · high confidence
Dependencies
Initial project setup with PHP 8.4 and DCB libraries
The project has been initialized with a new composer.json file, establishing the PHP version constraint (\>=8.4) and defining dependencies for the Dynamic Consistency Boundary pattern, specifically wwwision/dcb-eventstore and wwwision/dcb-eventstore-doctrine, along with development tools like PHPStan, PHPUnit, and Behat.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 75 → 74 (-1.4)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 99 (-0.6)
- Architecture 69 → 69 (+0.0)
- Maturity 90 → 90 (+0.0)
- Readiness 74 → 65 (-9.6)
- Security 80 → 97 (+17.0)
Resolved (13)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (7 lines × 2) (src/CommandHandler.php)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No exposed public API
- Test reliability not included
- The README mentions wwwision/dcb-eventstore but does not explain why this adapter was selected over alternatives. (README.md)
- early-stage repository — too little history to judge knowledge freshness
- git history depth insufficient
- git history depth insufficient
- single-maintainer — knowledge-concentration (bus factor) risk
New (13)
- Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (7 lines × 2) (src/Command/SubscribeStudentToCourse.php)
- Duplicated block (8 lines × 2) (src/CommandHandler.php)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- No dependency advisory monitoring
- TodoComment (src/Projection/CompositeProjection.php)
- TodoComment (src/Projection/CompositeProjection.php)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
bwaidelich/dcb-example-courses was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 50e50a2f4332bbe6e23d5e03f0189a968fcad563 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.