Skip to content
CAI
Software that uses CAICheck a score

friends-of-ddd/event-driven

63.2

Adequate · 22 September 2026

302

lines of production code

PHP

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a PHP library that provides abstractions for implementing event-driven architectures, specifically supporting the Command and Event Bus patterns. It offers domain-level interfaces for tracking and managing events, along with in-memory implementations for testing and event sourcing scenarios. The codebase includes comprehensive test coverage for message collections and event streams, ensuring reliable dispatch and storage of commands and events.

Features

Initial release of the Event-Driven library

The repository now contains the full source code and configuration for the 'friends-of-ddd/event-driven' PHP library, which provides abstractions for the Command Bus and Event Bus patterns following Domain-Driven Design principles. This initial commit establishes the project structure, including the core message interfaces, command and event definitions, and the necessary build and testing infrastructure (PHPStan, PHPUnit, and CS Fixer) to support development.

(repo-wide) · high confidence

Introduce domain interfaces and collections for event-driven architecture

Added new domain-layer contracts and implementations to support event-driven patterns. This includes the \EventAwareInterface\ and \EventAwareTrait\ to manage recorded events, the \EventInterface\ extending \MessageInterface\, and a new \MessageCollection\ class that provides methods to add, filter, and diff message collections. These changes enable domain objects to track and retrieve their associated events in a structured, iterable manner.

src/Domain · high confidence

Behavioural changes

Introduces distinct interfaces for command and event buses

The generic MessageBusInterface has been split into specialized interfaces: CommandBusInterface for dispatching commands and EventBusInterface for dispatching events. This separation allows for more specific type handling in the application layer. Additionally, new interfaces for event stream providers and in-memory implementations (VoidEventBus, InMemoryEventStreamProviderDecorator) are introduced to support event sourcing and testing scenarios.

src/Application · high confidence

Test coverage

Added test kit for event-driven command handling; Added unit tests for MessageCollection and InMemoryEventStreamProviderDecorator.

Dependencies

Initial project setup with PHP 8.2+ and key dependencies

The project is initialized with composer.json and composer.lock, establishing a PHP 8.2+ runtime requirement and defining core dependencies including psr/container ^2.0, along with development tools phpunit ^10.5.15, php-cs-fixer ^3.52, and phpstan ^2.1.

(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

Score

  • CAI 66 → 63 (-2.4)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 57 → 52 (-5.0)
  • Readiness 64 → 64 (-0.6)
  • Security 97 → 98 (+1.1)

Resolved (9)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High CVE: [GHSA redacted] (composer.lock)
  • High CVE: [GHSA redacted] (composer.lock)
  • Medium IaC: CKV_DOCKER_3 (docker/php/Dockerfile)
  • No exposed public API
  • Test reliability not included
  • no production source files with tracked history to analyse
  • single-maintainer — knowledge-concentration (bus factor) risk

New (8)

  • Documentation: no architecture or design documentation (README.md)
  • Documentation: no licence statement (README.md)
  • High CVE: [GHSA redacted] (composer.lock)
  • High CVE: [GHSA redacted] (composer.lock)
  • Inconsistent parameter typing for dispatch operations. CommandBusInterface and EventBusInterface expect specific subtypes (CommandInterface and EventInterface), but VoidEventBus (an implementation of EventBusInterface presumably, or a related component) accepts the broader MessageInterface. If VoidEventBus implements EventBusInterface, this is a signature mismatch (contravariance violation in parameter type). If it is a separate component, the naming VoidEventBus suggests it is an EventBus, yet it accepts MessageInterface instead of EventInterface.
  • Inconsistent return types for conceptually similar operations. EventStreamProviderInterface returns the interface MessageCollectionInterface, while EventAwareInterface returns the concrete class MessageCollectionInterface (which is actually an interface, but the trait returns the concrete MessageCollection). More critically, EventAwareTrait returns the concrete MessageCollection while the interface EventAwareInterface declares it returns MessageCollectionInterface. This breaks the Liskov Substitution Principle expectation that implementations match the interface contract exactly, and creates confusion between interface and concrete type returns.
  • Medium IaC: WD-DOCKER-0003 (docker/php/Dockerfile)
  • No dependency advisory monitoring

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

friends-of-ddd/event-driven 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 22 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 4ee1790a7c8928e78706ace78ba6716749603d19 — 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-821afab8930d.