Skip to content
CAI
Software that uses CAICheck a score

symfony/dotenv

54.9

Adequate · 19 September 2026

1.1k

lines of production code

PHP

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the Symfony Dotenv component, a library responsible for loading and managing environment variables from .env files. It provides utilities to parse, validate, and compile environment configurations into optimized PHP files, while offering console commands to inspect and debug these variables. The component ensures type safety and modern PHP compatibility through updated exception handling and strict typing.

Features

New dotenv:dump and debug:dotenv console commands

The Dotenv component now includes two new console commands: \dotenv:dump\ compiles .env files into a PHP-optimized \.env.local.php\ file for production use, and \debug:dotenv\ lists all dotenv files and their variables, supporting filtering by variable name. These commands allow developers to manage and inspect environment variable configurations directly from the command line.

Command · high confidence

Behavioural changes

Dotenv component behavior changes and new loading methods

The Dotenv component now introduces \bootEnv()\ and \loadEnv()\ methods to simplify environment loading, with \bootEnv()\ checking for a pre-compiled \.env.local.php\ file first. The \loadEnv()\ method automatically loads \.env.local\ and environment-specific files (\.env.$env\) while ignoring \.env.local\ in test environments. Environment variable parsing has been updated to allow variable names starting with underscores and supports deferred variable expansion to handle overrides from subsequent files correctly. The \usePutenv\ property default is removed, disabling \putenv()\ by default for thread safety. Additionally, the \debug:dotenv\ command now supports filtering variables, and a new \dotenv:dump\ command allows compiling \.env\ files into a PHP-optimized \.env.local.php\ file.

(repo-wide) · high confidence

Dotenv exception classes updated for PHP 7+ compatibility and new error type

The Dotenv component's exception hierarchy has been modernized: the ExceptionInterface now extends \\Throwable, allowing it to catch broader error types. Specific exception classes (FormatException, PathException) now accept ?\\Throwable for the previous exception instead of \\Exception, and their constructors and properties use strict type hints (string, int) with promoted properties. A new VariableCircularReferenceException has been added to handle circular variable indirection errors. These changes improve type safety and align with modern PHP standards.

Exception · high confidence

Test coverage

Added tests for Dotenv debug and dump commands; Updated Dotenv parser tests to PHPUnit 9+ attributes and expanded coverage.

Dependencies

Update PHP requirement and Symfony dependencies

The minimum PHP version has been raised to 8.4.1, and development dependencies have been updated to use Symfony Console and Process versions 7.4 or 8.0. Additionally, legacy configuration such as the branch-alias has been removed from the manifest.

(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

Baseline

  • First survey — no prior run to compare against. CAI 55.

Lenses

  • Code Health 86
  • Architecture 69
  • Maturity 53
  • Readiness 43
  • Security 100

Changes since last survey

  • 300 commits — 276 feature/other, 24 fixes

By area

  • (repo) — 169 commits
  • (root) — 92 commits
  • Command/DebugCommand.php — 14 commits
  • Tests/DotenvTest.php — 9 commits
  • Tests/Command — 8 commits
  • Command/DotenvDumpCommand.php — 6 commits
  • .github/PULL_REQUEST_TEMPLATE.md — 1 commit
  • Exception/FormatException.php — 1 commit

Notable commits

  • fix: Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  • fix: Backport type fixes
  • fix: CS fixes
  • fix: CS fixes
  • fix: Fix CHANGELOG
  • fix: Fix branch-version
  • fix: Fix markdown
  • fix: Revert "minor #54653 Auto-close PRs on subtree-splits (nicolas-grekas)"
  • fix: Various CS fixes
  • fix: [CS] Fix command descriptions (code conventions)
  • fix: [Dotenv] Fix bootEnv() override with .env.local.php when the env key already exists
  • fix: [Dotenv] Fix double-unescaping of backslashes during deferred variable resolution
  • fix: [Dotenv] Fix escaped dollar signs lost during deferred variable resolution
  • fix: [Dotenv] Fix phpdoc Dotenv
  • fix: [Dotenv] Fix preloading warning by replacing anonymous exception class
  • fix: [Dotenv] Fix reading config for symfony/runtime when running dump command
  • fix: [Dotenv] Fix self-referencing variable resolution with suffix/prefix
  • fix: [Dotenv] Fix self-referencing variables with defaults and env key resolution during deferred expansion
  • fix: [Dotenv] Fix testBootEnv() to start from a fresh context
  • fix: [Dotenv] Fix testLoadEnv() .env.dist isolation
  • …and 280 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

symfony/dotenv 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 19 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 4ea87b35c75f7052309ec9735c0eb5c1fd7d2182 — 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-13a154b7f5d1.