ddd-by-examples/library-php
61.4
Adequate · 22 September 2026
1.4k
lines of production code
PHP
primary language
7
measurements over time
What this system is
This system is a library management application built on the Symfony framework, designed to manage book catalogues and patron lending activities. It provides domain models and business logic for maintaining a book catalogue and processing book holds, including validation of patron eligibility and hold limits. The architecture leverages Domain-Driven Design principles, utilizing domain events and value objects to handle core operations like checkouts and holds.
How it got here
2019 — Initial project scaffolding and domain modeling
8 changes.
This period focused on establishing the foundational infrastructure and core domain models for the library system. It involved setting up the development environment, configuring dependencies, and implementing key domain entities such as the Catalogue, Lending, and shared kernel components. The work also introduced domain-driven design patterns, including event publishing and policy enforcement for book holds.
2020–2024 — Initial project scaffolding and domain modeling
4 changes.
This period established the foundational architecture of the library application, introducing Symfony and Doctrine for the backend framework and database management. It included the creation of initial database schemas for checkouts and holds, alongside the implementation of core domain logic such as patron hold validation and result handling.
Features
Add Result enum for success and rejection states
A new Result enum is introduced in the Common/Result module, defining two string-backed cases: SUCCESS and REJECTION. This provides a structured way to represent the outcome of operations within the library.
src/Common/Result · high confidence
Add Version aggregate class
A new Version class has been introduced in the Common/Aggregate namespace. This class serves as a value object for tracking version numbers, providing a zero-initialization helper and an immutable structure for version data.
src/Common/Aggregate · high confidence
Initial project scaffolding and development environment setup
The repository is initialized with a complete development environment, including a PHP 8.3 Docker container, a PostgreSQL 16 database service, and a Makefile for managing the Docker Compose setup. The project is configured with Symfony and Doctrine, and includes tooling for code quality and testing: PHPStan for static analysis, php-cs-fixer for code style, PHPUnit for unit testing, and Behat for behavior-driven development scenarios. A .env file is provided for environment configuration.
(repo-wide) · high confidence
Initial project scaffolding with Symfony and Doctrine migrations
The application now includes the standard Symfony console entry point (bin/console) and public index (public/index.php) to bootstrap the application using the Akondas\\Library\\Common\\Kernel. Additionally, a new database migration (Version20240613055441) has been added to create 'checkouts\_sheet' and 'holds\_sheet' tables, establishing the initial schema for library checkout and hold records.
bin, migrations, public · high confidence
Introduce domain event infrastructure
Added the foundational components for domain-driven design by introducing the DomainEvent interface, which enforces the presence of an event ID, an aggregate ID, and a timestamp. Additionally, the DomainEventPublisher interface was added to handle the publishing of these events, enabling the system to dispatch domain events to subscribers or other systems.
src/Common/Event · high confidence
Introduce domain models and policies for placing book holds
Added domain classes for managing book holds, including the \Patron\ entity with a \placeOnHold\ method that enforces business rules via \PlacingOnHoldPolicy\ implementations. These policies restrict regular patrons from holding restricted books, placing open-ended holds, or exceeding the maximum number of active holds. The change also introduces supporting domain models such as \PatronHolds\ to track active holds, \Hold\ and \HoldDuration\ to represent the state and time limits of a hold, and domain events like \BookPlacedOnHold\ and \BookHoldFailed\ to record the outcome of hold attempts.
src/Lending · high confidence
Introduce shared Kernel and UUID value objects
Added src/Common/Kernel.php, a Symfony application kernel extending BaseKernel with MicroKernelTrait, and src/Common/UUID.php, a readonly value object wrapping Symfony's Uid component to generate and validate UUID v7 identifiers. This provides a centralized, reusable way to handle unique identifiers across the application.
src/Common · high confidence
Introduce the Catalogue domain model and service
Added the core Catalogue domain classes (Author, Book, BookId, BookInstance, BookType, ISBN, Title) and the Catalogue service, enabling users to add books and book instances to the library catalogue and retrieve book details by ISBN.
src/Catalogue · high confidence
Behavioural changes
Added hold placement validation for patrons
Added a new feature file defining the behavior for placing books on hold. It specifies that regular patrons are limited to a maximum of 5 holds and cannot hold restricted books, while researcher patrons can hold any number of circulating books.
features/lending · medium confidence
Initial Symfony and Doctrine configuration for the application
The application is now configured to use the Symfony framework and Doctrine ORM, enabling database connectivity, caching, routing, and dependency injection. The configuration includes database connection settings via environment variables, Doctrine migrations setup, and service definitions for the DailySheet domain, including a NativeClock implementation and the DbalDailySheet repository.
config · medium confidence
Test coverage
Added test coverage for library lending domain
Added tests for the patron hold placement logic, including restrictions on regular patrons placing holds on restricted books and requesting open-ended holds. Also added tests for the daily sheet model, covering the transformation of overdue checkouts and expired holds into domain events. Additionally, unit tests were added for the catalogue service, UUID validation, and checkout duration calculations.
tests · high confidence
Dependencies
Initial project setup with PHP 8.3 and key dependencies
The project is initialized with PHP 8.3 and a set of core dependencies including Symfony 7.1 (framework, console, clock, etc.), Doctrine bundles and DBAL, the Munus library, and development tools like PHPUnit, Behat, and PHPStan.
(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 59 → 61 (+2.7)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 98 (-1.7)
- Architecture 69 → 69 (+0.0)
- Maturity 61 → 61 (+0.0)
- Readiness 45 → 49 (+4.1)
- Security 78 → 90 (+11.6)
- Domain Modelling 100 → 100 (+0.0)
Resolved (19)
- 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)
- High CVE: [GHSA redacted] (composer.lock)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low CVE: [GHSA redacted] (composer.lock)
- Medium CVE: [GHSA redacted] (composer.lock)
- Medium CVE: [GHSA redacted] (composer.lock)
- Medium CVE: [GHSA redacted] (composer.lock)
- Medium IaC: CKV_DOCKER_3 (Dockerfile)
- No exposed public API
- Test reliability not included
- early-stage repository — too few commits for a meaningful bus factor
- early-stage repository — too little history to judge knowledge freshness
- git history depth insufficient
- git history depth insufficient
New (26)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (27 lines × 3) (src/Lending/Patron/Domain/PatronEvent/BookHoldCanceled.php)
- Duplicated block (30 lines × 2) (src/Lending/Patron/Domain/PatronEvent/BookHoldFailed.php)
- High CVE: [GHSA redacted] (composer.lock)
- High CVE: [GHSA redacted] (composer.lock)
- High CVE: [GHSA redacted] (composer.lock)
- High IaC: WD-DOCKER-0001 (Dockerfile)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low CVE: [GHSA redacted] (composer.lock)
- Medium CVE: [GHSA redacted] (composer.lock)
- Medium CVE: [GHSA redacted] (composer.lock)
- Medium CVE: [GHSA redacted] (composer.lock)
- Medium IaC: WD-COMPOSE-0002 (docker-compose.yaml)
- Medium IaC: WD-DOCKER-0003 (Dockerfile)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- No ADRs found
- …and 6 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ddd-by-examples/library-php 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 805e09c2147f154dead252e9d6a4cf202602a768 — 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.