symfony/config
56.7
Adequate · 19 September 2026
7.5k
lines of production code
PHP
primary language
1
measurement over time
What this system is
This system is a configuration management library that provides a robust, tree-based structure for defining, validating, and loading application settings. It supports multiple input formats including YAML, XML, and PHP, while offering tools to generate documentation and JSON schemas from configuration definitions. The system also includes a resource tracking mechanism to monitor file and class dependencies for cache freshness.
How it got here
2011 — Config component modernization and definition system
7 changes.
This period focused on modernizing the Symfony Config component by introducing a comprehensive tree-based definition system with a fluent builder API for complex configuration structures. It also enhanced reliability and type safety through a new service-based resource validation system, self-checking resources, and improved exception handling for loaders and file locations.
2012 — Config component test coverage and XML utilities
9 changes.
This period focused on expanding unit test coverage for the Symfony Config component, specifically targeting cache, locator, definition builder, loader, and resource classes. It also introduced a new XmlUtils class to centralize XML parsing and conversion logic, accompanied by comprehensive tests and fixtures for these new utilities.
2013–2025 — Configuration definition and documentation tools
11 changes.
This period focused on enhancing the Config component by introducing new dumpers for generating JSON Schema and human-readable reference documentation from configuration trees. It also added a PHP-based configuration definition loader and a typed configurator to streamline the creation of configuration definitions. Comprehensive test coverage and exception handling improvements were implemented to support these new features.
Features
Introduction of the Config Definition Builder API
The Symfony Config component now provides a fluent builder API for defining configuration trees, allowing developers to programmatically construct and validate complex configuration structures. This change introduces a suite of new classes in the \Definition/Builder\ namespace, including \TreeBuilder\ as the entry point, \NodeBuilder\ for creating child nodes, and specific definition classes for various data types such as \ArrayNodeDefinition\, \BooleanNodeDefinition\, \IntegerNodeDefinition\, \FloatNodeDefinition\, \StringNodeDefinition\, \EnumNodeDefinition\, and \VariableNodeDefinition\. The API supports advanced configuration features like normalization rules via \ExprBuilder\, validation constraints, default values, and prototype definitions for array nodes. Additionally, new interfaces like \BuilderAwareInterface\ and \ParentNodeDefinitionInterface\ facilitate the construction of nested and hierarchical configuration structures.
Definition/Builder · high confidence
Introduction of the Symfony Config Definition component
This change introduces the \Symfony\\Component\\Config\\Definition\ component, providing a complete tree-based configuration system. It adds core node types (Array, Boolean, Enum, Float, Integer, Numeric, Scalar, String, Variable) and a Processor to normalize, merge, and finalize configuration arrays. The component also includes an \ArrayShapeGenerator\ to produce PHPDoc type hints from configuration trees, a \ConfigurableInterface\ for modern definition syntax, and specific exception classes for validation errors.
Definition · high confidence
New DefinitionConfigurator class for typed configuration definition
A new DefinitionConfigurator class has been introduced in the Config component to streamline configuration definition. It wraps a TreeBuilder and DefinitionFileLoader, providing a typed rootNode() method that returns specific node definition types (such as ArrayNodeDefinition, StringNodeDefinition, etc.) based on a generic type parameter, and exposes an import() method to load external configuration resources.
Definition/Configurator · high confidence
New PHP-based configuration definition loader
A new \DefinitionFileLoader\ class has been introduced to allow configuration definitions to be loaded from PHP files. This loader supports a callable callback pattern where the included PHP file returns a closure that receives a \DefinitionConfigurator\ instance, enabling type-safe definition of configuration trees without relying on YAML or XML formats.
Definition/Loader · high confidence
New XmlUtils class for XML parsing and conversion
A new \Symfony\\Component\\Config\\Util\\XmlUtils\ class has been introduced to centralize XML operations. It provides static methods to parse XML strings (\parse\) and load XML files (\loadFile\), including support for XSD schema validation or custom callable validators. Additionally, it offers \convertDomElementToArray\ to transform DOM elements into PHP arrays, with an option to check attribute prefixes. The class ensures the DOM extension is available and handles libxml error clearing to prevent state leakage between operations.
Util · high confidence
New configuration reference dumpers and JSON Schema generator
Added three new dumper classes in the Config component: JsonSchemaDumper, XmlReferenceDumper, and YamlReferenceDumper. JsonSchemaDumper generates a JSON Schema (draft 2020-12) from a configuration tree, supporting node aliases, prototyped arrays, enums, and custom parameter schemas. XmlReferenceDumper and YamlReferenceDumper produce human-readable XML and YAML reference files that document configuration nodes, including their types, default values, examples, required status, deprecation notices, and permissible values. These tools allow developers to automatically generate documentation and validation schemas from their application's configuration definitions.
Definition/Dumper · high confidence
New self-checking resource types and updated FileResource behavior
The Resource component introduces several new resource classes that implement SelfCheckingResourceInterface, allowing the framework to validate freshness autonomously: ClassExistenceResource tracks whether a class exists, ComposerResource monitors PHP version and vendor dependencies, DirectoryResource watches directory trees (optionally filtered by pattern), FileExistenceResource checks simple file/directory existence, GlobResource handles glob patterns, and ReflectionClassResource tracks class definitions via reflection. Additionally, FileResource now implements SelfCheckingResourceInterface, supports both files and directories, validates existence in the constructor, and uses filemtime for freshness checks, while ResourceInterface now extends Stringable.
Resource · high confidence
Behavioural changes
Config loader API modernization and glob support
The Config component's loader system has been updated to use modern PHP types (mixed, union types) and stricter interfaces. A new GlobFileLoader allows loading resources via glob patterns, and the FileLoader now supports an exclude parameter to filter out specific files during import. Additionally, a new DirectoryAwareLoaderInterface enables loaders to be scoped to a specific directory, and circular import detection has been added to prevent infinite loops during configuration loading.
Loader · high confidence
New XML parsing exception hierarchy
The XML configuration utility now introduces a dedicated exception hierarchy to better distinguish parsing errors. A new \XmlParsingException\ class extends \InvalidArgumentException\ to represent general XML parsing failures, while a new \InvalidXmlException\ extends this base class to specifically handle errors unrelated to the parsing process itself, such as issues with XSD schema validation or callable validators.
Util/Exception · high confidence
Refactor Config caching and file location for better reliability and type safety
The Config component introduces a service-based resource validation system for cache freshness, replacing the previous direct \ResourceInterface::isFresh()\ checks. This is achieved by extracting cache logic into \ResourceCheckerConfigCache\ and \ConfigCacheFactory\/\ResourceCheckerConfigCacheFactory\, allowing custom \ResourceCheckerInterface\ implementations to validate cached resources. \ConfigCache\ now extends this new base class, supporting \SelfCheckingResourceChecker\ and \SkippingResourceChecker\. Additionally, \FileLocator\ and \FileLocatorInterface\ have been updated with strict type hints, and \FileLocator::locate()\ now throws the specific \FileLocatorFileNotFoundException\ instead of a generic \InvalidArgumentException\ when files are missing or when an empty name is provided.
(repo-wide) · high confidence
Refactored Config exception classes with improved error messages and new specific exceptions
The Config component's exception hierarchy has been restructured to provide clearer, more actionable error messages for resource loading failures. A new \LoaderLoadException\ replaces the previous \FileLoaderLoadException\, featuring enhanced message formatting that includes context about the source resource and specific guidance for bundle registration or loader support. Additionally, two new exception classes have been introduced: \FileLoaderImportCircularReferenceException\ to explicitly handle circular import detection, and \FileLocatorFileNotFoundException\ which extends \InvalidArgumentException\ and exposes the list of attempted paths via a \getPaths()\ method. The \LogicException\ class remains a simple extension of the native PHP exception.
Exception · high confidence
Test coverage
Added XML test fixtures for validation and error handling; Added test fixture for FakeVendor base class; Added test fixture for simple node configuration; Added test fixtures for Config Builder node definitions; Added test fixtures for Config component enum and resource handling; Added test fixtures for conditional class loading and hidden files; Added test fixtures for configuration tree validation; Added tests for DefinitionFileLoader; Added tests for JSON Schema, XML Reference, and Yaml Reference dumpers; Added tests for LoaderLoadException message formatting; Added tests for Symfony Config XmlUtils; Added unit tests for Config Resource classes; Added unit tests for Config component cache and locator classes; Added unit tests for the Config Definition Builder component; Added unit tests for the Config Loader components.
Dependencies
Symfony Config component updated for PHP 8.4+ and Symfony 8 compatibility
The symfony/config package now requires PHP 8.4.1 or higher and has updated its dependencies to support Symfony 7.4 and 8.0 versions. Specifically, symfony/filesystem, symfony/event-dispatcher, symfony/finder, symfony/messenger, and symfony/yaml are now constrained to ^7.4\|^8.0, while symfony/deprecation-contracts and symfony/service-contracts support versions ^2.5\|^3. The autoload configuration has been standardized to PSR-4, and the Tests directory is excluded from the classmap.
(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 57.
Lenses
- Code Health 84
- Architecture 99
- Maturity 48
- Readiness 43
- Security 100
Changes since last survey
- 300 commits — 263 feature/other, 37 fixes
By area
- (repo) — 166 commits
- (root) — 39 commits
- Tests/Definition — 18 commits
- Definition/Builder — 17 commits
- Tests/Builder — 15 commits
- Definition/ArrayShapeGenerator.php — 8 commits
- Resource/ReflectionClassResource.php — 5 commits
- Definition/Dumper — 4 commits
- Resource/ClassExistenceResource.php — 4 commits
- Definition/ArrayNode.php — 3 commits
- Tests/Resource — 3 commits
- Builder/ConfigBuilderGenerator.php — 2 commits
- Definition/Configurator — 2 commits
- Tests/Fixtures — 2 commits
- Tests/Loader — 2 commits
- .github/PULL_REQUEST_TEMPLATE.md — 1 commit
- Builder/ArrayShapeGenerator.php — 1 commit
- Builder/ClassBuilder.php — 1 commit
- Definition/BaseNode.php — 1 commit
- Definition/EnumNode.php — 1 commit
Notable commits
- fix: CS fixes
- fix: CS fixes - native_function_invocation & static_lambda
- fix: Fix incorrect serialized data mangling
- fix: Fix various bool-type coercions
- fix: Minor fixes around parse_url() checks
- fix: More CS fixes
- fix: Revert "minor #54653 Auto-close PRs on subtree-splits (nicolas-grekas)"
- fix: Various CS fixes
- fix: [Config] Fix ArrayShapeGenerator required keys with deep merging
- fix: [Config] Fix NodeDefinition template to be covariant
- fix: [Config] Fix Yaml dumper for prototyped array with default null
- fix: [Config] Fix GlobResource pattern with trailing slash
- fix: [Config] Fix ReflectionClassResource hash validation
- fix: [Config] Fix YamlReferenceDumper handling of array examples
- fix: [Config] Fix array shape for canBeEnabled / canBeDisabled
- fix: [Config] Fix array shape generation for backed enums
- fix: [Config] Fix array-shape generator dropping alternative types on nested PrototypedArrayNode
- fix: [Config] Fix dumping keyless prototyped arrays of arrays in XmlReferenceDumper
- fix: [Config] Fix generating array-shapes that list enum cases
- fix: [Config] Fix generics on TreeBuilder and ArrayNodeDefinition
- …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/config 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 81ed3e007bbb56be916bfa47a4571581caed03ee — 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.