Skip to content
CAI
Software that uses CAICheck a score

robiningelbrecht/php-slim-skeleton

59.9

Adequate · 21 September 2026

1.8k

lines of production code

PHP

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This is a PHP-based backend application scaffolded with a strict architectural pattern combining CQRS and event-driven design. It provides infrastructure for managing asynchronous command processing via RabbitMQ, handling domain events, and executing console tasks. The system emphasizes type safety, automated dependency injection, and comprehensive test coverage for its core infrastructure components.

Features

Add default Nginx configuration for PHP-FPM proxying

A new default Nginx configuration file has been added to the Docker setup. This configuration sets up the web server to listen on port 80, serve static files from /var/www/public, and proxy PHP requests to a PHP-FPM container on port 9000. This enables the container to correctly route PHP requests to the backend service.

docker/nginx · high confidence

Added AMQP queue infrastructure and worker interfaces

Introduced the core AMQP infrastructure components in the codebase, including the Queue interface and its implementations (AmqpQueue, DelayedQueue, and DelayedQueueFactory) for publishing messages to RabbitMQ. The change also adds the Worker interface and its base implementation (BaseWorker) to handle message consumption, along with a QueueContainer to manage registered queues and a QueueCompilerPass for dependency injection registration.

src/Infrastructure/AMQP/Queue · high confidence

Added Environment enum and Settings class for configuration management

Introduced a new Environment enum with DEV, PRODUCTION, and TEST cases, alongside a Settings class that loads application configuration from a PHP file and provides a dot-notation accessor for nested settings. This provides a structured way to manage environment-specific configurations and access settings hierarchically.

src/Infrastructure/Environment · high confidence

Added FailedQueue implementation and factory

A new FailedQueue class and its corresponding factory have been introduced to the AMQP infrastructure. The FailedQueue extends the existing AmqpQueue base class and overrides specific behaviors: it appends '-failed' to the original queue's name, returns zero for the number of consumers, and throws a RuntimeException when attempting to retrieve a worker, effectively disabling worker processing for failed messages. The factory encapsulates the creation of these failed queue instances.

src/Infrastructure/AMQP/Queue/FailedQueue · high confidence

Added MySQL database initialization script

A new SQL script, mysql.databases.sql, has been added to the docker/mysql directory. This script contains commented-out statements to create databases and grant root access, likely serving as a template or reference for MySQL container setup.

docker/mysql · high confidence

Added console entry point for the application

A new bin/console script has been added to serve as the CLI entry point for the application. It bootstraps the environment, instantiates the dependency injection container via ContainerFactory, and runs the Symfony Console application.

bin · high confidence

Added new console commands for AMQP consumption and cache clearing

The application now includes two new Symfony console commands: 'app:amqp:consume' to start consuming a specified AMQP queue with graceful signal handling, and 'app:cache:clear' to remove cache directories for Doctrine and Slim. These commands provide direct CLI interfaces for queue consumption and cache management.

src/Console · high confidence

Added public entry point for the application

A new public/index.php file has been added to serve as the application's entry point. This file is responsible for loading the Composer autoloader and executing the bootstrap configuration, effectively routing the initial request to the application's core logic.

public · high confidence

Added value object infrastructure for identifiers and string literals

Introduced new value object classes to enforce type safety and validation for identifiers and string literals. The 'Identifier' class provides a base for creating unique identifiers with prefix validation and random generation capabilities. The 'NonEmptyStringLiteral' class ensures string values are never empty, supporting both required and optional string creation. A 'StringLiteral' interface and 'UuidFactory' helper were also added to support these value objects.

src/Infrastructure/ValueObject · high confidence

Automated console command registration via compiler pass

The application now automatically discovers and registers Symfony console commands using a new \ConsoleCommandCompilerPass\ and \ConsoleCommandContainer\. This infrastructure change allows developers to add new console commands simply by using the \AsCommand\ attribute, with the system handling the registration process automatically.

src/Infrastructure/Console · high confidence

Initial project scaffolding and configuration

The repository was initialized with essential configuration files to support development and testing workflows. This includes environment variable templates (.env.dist, .env.test, .env.github-actions) for database and RabbitMQ connectivity, a Docker Compose setup for local development with MySQL and RabbitMQ services, and a PHP-PMF (PHP-CS-Fixer) configuration. Additionally, static analysis is configured via PHPStan (level 8) with a baseline for existing issues, and the project is set up with PHPUnit 10 for testing, including a pretty-print extension. The README was also updated to reflect the new skeleton structure and installation instructions.

(repo-wide) · high confidence

Introduce AMQP infrastructure for message queue integration

Added new classes in src/Infrastructure/AMQP to enable AMQP-based message processing. This includes AMQPChannelFactory for managing RabbitMQ channels, AMQPStreamConnectionFactory for connection management, AMQPChannelOptions for queue configuration, Consumer for handling message consumption with signal-safe processing, and Envelope as a marker interface for message envelopes.

src/Infrastructure/AMQP · high confidence

Introduce CQRS infrastructure for command handling and queueing

Added new classes to support a Command-Query Responsibility Segregation (CQRS) pattern within the application's infrastructure layer. This includes a \CommandBus\ to manage and dispatch commands to their respective handlers, a \DomainCommand\ base class for serializing command payloads, and \CommandQueue\/\CommandQueueWorker\ classes to handle asynchronous command processing via AMQP. These changes enable the system to persist and process commands through a dedicated queue, with failed commands routed to a failure queue for inspection.

src/Infrastructure/CQRS · high confidence

Introduce convention-based event listener infrastructure

Added new infrastructure for handling domain events through a convention-based approach. This includes an EventListener interface, a ConventionBasedEventListener abstract class that automatically discovers and routes events based on method naming conventions, and an EventListenerType enum to distinguish between projectors and process managers. The EventListenerCompilerPass registers these listeners with the EventBus, enabling automatic subscription of event handlers.

src/Infrastructure/Eventing/EventListener · high confidence

Introduced JSON serialization utility class

A new Json class has been added to the Infrastructure/Serialization layer, providing static methods for encoding and decoding JSON data. The implementation wraps the standard json\_encode and json\_decode functions, with the encode method specifically catching exceptions to provide more detailed error messages.

src/Infrastructure/Serialization · high confidence

Introduced base repository class with eventing support

Added DbalAggregateRootRepository, an abstract base class for database-backed repositories that integrates with the EventBus to publish domain events.

src/Infrastructure/Repository · high confidence

Introduced core eventing infrastructure for domain events

Added the foundational classes for handling domain events within the application's infrastructure layer. The \AggregateRoot\ base class provides a mechanism to record and retrieve domain events, while the \DomainEvent\ abstract class standardizes event serialization via JSON. The \EventBus\ class manages the subscription of event listeners and coordinates the publishing and dispatching of domain events to registered handlers.

src/Infrastructure/Eventing · high confidence

Introduced structured dependency injection container with compiler passes and compilation support

The application now uses a new \ContainerBuilder\ and \ContainerFactory\ to manage dependency injection. This change introduces a \CompilerPass\ interface and a \ContainerBuilder\ that supports adding multiple compiler passes, caching class attribute resolution, and enabling container compilation for performance optimization in production environments. The \ContainerFactory\ loads environment settings, configures compilation and caching directories based on the environment, and builds the final container. This provides a more modular and performant way to manage dependencies and compile the container for production use.

src/Infrastructure/DependencyInjection · high confidence

New CQRS command handling infrastructure

The application introduces a new Command Query Responsibility Segregation (CQRS) infrastructure layer. This includes a \CommandHandler\ interface to define command processing contracts, a \CanNotRegisterCommandHandler\ exception class for error handling, and a \CommandHandlerCompilerPass\ that automatically discovers and registers command handlers tagged with the \AsCommandHandler\ attribute into the \CommandBus\. This enables automatic wiring of command handlers via dependency injection container compilation.

src/Infrastructure/CQRS/CommandHandler · high confidence

New attribute-based class discovery with caching

The application now uses PHP 8 attributes to mark classes for automatic discovery and registration. New attribute classes—AsAmqpQueue, AsCommandHandler, and AsEventListener—allow developers to tag classes for specific infrastructure concerns. A new ClassAttributeResolver scans the codebase to find classes with these attributes, and a ClassAttributeCache stores the results to avoid repeated filesystem scans, improving startup performance.

src/Infrastructure/Attribute · high confidence

Behavioural changes

Added Whoops-based error rendering for development and API responses

The application now uses the Whoops library to render detailed, developer-friendly HTML error pages in the browser and structured JSON responses for API clients. This is implemented via new classes: WhoopsBuilder, WhoopsHtmlErrorRenderer, and WhoopsJsonErrorRenderer, which replace the default Slim error rendering with a more informative and styled output. A custom DefaultHtmlErrorRenderer is also introduced to provide a friendly 404 message for missing pages.

src/Infrastructure/Exception · high confidence

Added custom error page template

Introduced a new Twig template for rendering error pages, providing a styled HTML structure with a header, title, and a styled alert box for displaying error content. This replaces or supplements the default error rendering with a more polished, user-friendly interface.

templates · high confidence

Centralized configuration and container wiring for the application

The application's configuration and dependency injection setup have been reorganized into dedicated files within the config directory. A new container.php defines service bindings for Doctrine, Twig, AMQP, and console commands, while settings.php externalizes environment-dependent values (database credentials, cache directories, error handling options). Bootstrap and route/middleware registration are now explicit entry points, and compiler passes enable auto-discovery of commands, handlers, and listeners. This structure makes it easier to adjust settings, swap error renderers, and manage service definitions without modifying core application code.

config · high confidence

Test coverage

Added test infrastructure and error handling tests; Added tests for CQRS infrastructure components; Added tests for ClassAttributeCache and ClassAttributeResolver; Added tests for DbalAggregateRootRepository; Added tests for JSON serialization; Added tests for console command registration and container behavior; Added tests for the event listener infrastructure; Added unit tests for AMQP consume and cache clear console commands; Added unit tests for AMQP infrastructure components; Added unit tests for ValueObject infrastructure classes; Added unit tests for the ContainerBuilder class; Added unit tests for the Settings class; Added unit tests for the eventing infrastructure.

Dependencies

Initial project setup with PHP 8.2, Slim 4, and modern PHP tooling

The project is initialized with a composer.json defining a PHP 8.2+ environment using the Slim 4 framework, along with PHP-DI for dependency injection, Doctrine for database management, and phpunit 10 for testing. The configuration also includes PHPStan for static analysis, PHP-CS-Fixer for code style, and Whoops for error handling.

(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 62 → 60 (-2.5)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 98 (-2.0)
  • Architecture 100 → 66 (-34.3)
  • Maturity 47 → 49 (+1.4)
  • Readiness 60 → 62 (+2.1)
  • Security 84 → 86 (+2.6)

Resolved (11)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium IaC: CKV_DOCKER_3 (docker/php-cli/Dockerfile)
  • Medium IaC: CKV_DOCKER_3 (docker/php-fpm/Dockerfile)
  • No exposed public API
  • Test reliability not included
  • The README is a single file with no table of contents and the outlined topics (Initialize example; Start consuming the voting example queue; Some examples; Registering a new route) are not covered by any visible text. (README.md)
  • dormant codebase — no living knowledge left to concentrate

New (39)

  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Documentation: no architecture or design documentation (README.md)
  • Documentation: no installation or build instructions (README.md)
  • Duplicated block (6 lines × 2) (src/Infrastructure/CQRS/DomainCommand.php)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium IaC: WD-COMPOSE-0002 (docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker-compose.yml)
  • Medium IaC: WD-DOCKER-0003 (docker/php-cli/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (docker/php-fpm/Dockerfile)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • No assertions: testBuildWithoutCache (tests/Infrastructure/DependencyInjection/ContainerBuilderTest.php)
  • No assertions: testConsumeCallback (tests/Infrastructure/AMQP/ConsumerTest.php)
  • No assertions: testConsumeCallbackOnException (tests/Infrastructure/AMQP/ConsumerTest.php)
  • No assertions: testExecute (tests/Console/AmqpConsumeConsoleCommandTest.php)
  • No assertions: testHandleSignal (tests/Console/AmqpConsumeConsoleCommandTest.php)
  • No assertions: testNotifyThatForEventNotListeningTo (tests/Infrastructure/Eventing/EventListener/ConventionBasedEventListenerTest.php)
  • …and 19 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

robiningelbrecht/php-slim-skeleton 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 5ea02a592593a07575ce2117468e87983ecc6bc8 — 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.