Skip to content
CAI
Software that uses CAICheck a score

friends-of-ddd/event-driven

65.6

Adequate · 10 November 2026

302

lines of production code

PHP

primary language

9

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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 65 → 66 (+0.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 56 → 56 (+0.0)
  • Readiness 65 → 65 (+0.0)
  • Security 98 → 100 (+2.0)

Resolved (2)

  • Inconsistent parameter typing for dispatch operations. CommandBus and EventBus accept their specific domain interfaces (CommandInterface, EventInterface), but VoidEventBus (an implementation of EventBus) accepts the more generic MessageInterface. This breaks the contract expectation that an EventBus implementation should handle EventInterface.
  • Inconsistent return types for retrieving event collections. EventAwareInterface and EventStreamProviderInterface return MessageCollectionInterface, but EventAwareTrait returns the concrete class Message. This creates an inconsistency between the interface contract and the trait implementation, potentially causing type errors if code expects the interface return type.

Written by cca.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 10 November 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.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.