symfony/config
51.9
Adequate · 17 November 2026
8.1k
lines of production code
PHP
primary language
5
measurements over time
What this system is
Features
Add DefinitionConfigurator for typed configuration building
A new DefinitionConfigurator class has been introduced in the Config component to facilitate the definition of configuration trees. It wraps a TreeBuilder and a DefinitionFileLoader, exposing methods to import external resources and access the root node. The class utilizes PHP generics to provide type-safe return values for the root node, ensuring the returned definition matches the expected configuration type (such as array, scalar, string, boolean, integer, float, enum, or variable).
Definition/Configurator · high confidence
New PHP-based configuration definition loader
A new DefinitionFileLoader has been introduced to allow configuration definitions to be defined in PHP files. This loader executes the PHP file within a restricted closure scope to prevent access to the loader's internal state or $this, ensuring security and encapsulation. It supports defining configurations via a DefinitionConfigurator callback, automatically injecting the configurator, TreeBuilder, or FileLoader based on type hints.
Definition/Loader · high confidence
New XmlUtils class for XML parsing and validation
A new \XmlUtils\ class has been added to the \Config\ component 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. The class also includes \convertDomElementToArray\ to transform DOM elements into PHP arrays, with an option to check attribute prefixes. This refactoring extracts XML handling logic from existing loaders into a dedicated utility class.
Util · high confidence
New configuration definition node classes and array shape generation
The Definition component now includes a comprehensive set of new node classes (ArrayNode, BaseNode, BooleanNode, EnumNode, FloatNode, IntegerNode, NumericNode, ScalarNode, StringNode, VariableNode, and their interfaces) to define configuration trees, along with an ArrayShapeGenerator that produces PHPDoc array shapes for static analysis. This introduces a new capability for defining and validating configuration structures with specific type constraints (e.g., int, float, bool, string, enum) and generating corresponding type hints.
Definition · 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 documentation for configuration trees, including node info, examples, defaults, required status, deprecation notices, and permissible values. YamlReferenceDumper also supports dumping a specific sub-path of the configuration tree.
Definition/Dumper · high confidence
New self-checking resource system for improved cache freshness
The Resource component introduces a new SelfCheckingResourceInterface and a suite of resource classes (ClassExistenceResource, ComposerResource, DirectoryResource, FileExistenceResource, GlobResource, ReflectionClassResource) that perform their own freshness checks autonomously. This allows the framework to detect changes in class existence, Composer vendor dependencies, directory contents, file existence, and glob patterns without relying on external metadata. FileResource is updated to use xxh128 content hashing to detect modifications within the same second, and ResourceInterface is simplified to extend Stringable, enabling better de-duplication and serialization of resource states.
Resource · high confidence
Behavioural changes
Config component refactored with service-based cache validation and improved file locating
The Config component has been restructured to support service-based resource validation for cache freshness checks. A new \ResourceCheckerConfigCache\ class and \ResourceCheckerInterface\ allow custom checkers to validate cached data, while \ConfigCache\ now extends this base class to integrate \SelfCheckingResourceChecker\ and \SkippingResourceChecker\ in debug mode. A new \ConfigCacheFactory\ interface and implementations (\ConfigCacheFactory\, \ResourceCheckerConfigCacheFactory\) delegate cache instance creation. Additionally, \FileLocator\ now throws a specific \FileLocatorFileNotFoundException\ (instead of a generic \InvalidArgumentException\) when files are not found, and its \locate()\ method signature has been updated to explicitly return \string\|string\[\]\ with stricter type hints.
(repo-wide) · high confidence
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
Config tree builder API refactored with new node types and stricter validation
The configuration definition builder has been significantly refactored to support new node types and stricter validation rules. Boolean and numeric nodes now explicitly throw exceptions when \cannotBeEmpty()\ is called, preventing invalid configurations. New dedicated node types have been introduced, including \EnumNodeDefinition\ (supporting both explicit values and FQCNs), \IntegerNodeDefinition\, and \FloatNodeDefinition\ (which now support \min()\ and \max()\ constraints). The \ExprBuilder\ has been enhanced with new methods like \ifFalse()\, \ifEmpty()\, and \castToArray()\, while \ArrayNodeDefinition\ gains an \acceptAndWrap()\ method to handle type coercion. Additionally, the builder now supports deprecating nodes, aliasing configuration, and inlining environment variables during container compilation.
Definition/Builder · 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
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; 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 Definition Builder components; Added unit tests for Config Resource classes; Added unit tests for Config component cache and locator classes; Added unit tests for the Config Definition component.
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 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 51.6 → 51.9 (+0.3)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 61.7 → 61.2 (-0.5)
- Architecture 86.7 → 91.7 (+5.0)
- Maturity 41.0 → 40.9 (-0.1)
- Readiness 46.7 → 46.7 (0.0)
- Security 100.0 → 100.0 (0.0)
Resolved (3)
- Off-boarding risk: anonymized user #1
- Orphaned file (Definition/EnumNode.php)
- Projects may be oversized for their cohesion
New (12)
- BaseNode.normalize (cognitive 16) (Definition/BaseNode.php)
- Circular dependency (ConfigCache.php)
- Edited copy of a member (4 corresponding lines) (Definition/Dumper/XmlReferenceDumper.php)
- Edited copy of a member (6 corresponding lines) (ConfigCacheFactory.php)
- Edited copy of a member (9 corresponding lines) (Definition/BooleanNode.php)
- Off the main sequence: Exception
- Off-boarding risk: anonymized user #1
- Orphaned file (Definition/Loader/DefinitionFileLoader.php)
- Orphaned file (FileLocator.php)
- Orphaned file (Util/XmlUtils.php)
- ResourceCheckerConfigCache.write (cognitive 16) (ResourceCheckerConfigCache.php)
- Skipped (documented): testUnreadableSubdirectoryDoesNotPreventLoading (Tests/Resource/DirectoryResourceTest.php)
Changes since last survey
- 20 commits — 16 feature/other, 4 fixes
By area
- (repo) — 13 commits
- Resource/DirectoryResource.php — 2 commits
- (root) — 1 commit
- Definition/BaseNode.php — 1 commit
- Definition/EnumNode.php — 1 commit
- Resource/GlobResource.php — 1 commit
- Tests/Definition — 1 commit
Notable commits
- fix: [Config] Fix DirectoryResource checking the parent directory on Windows
- fix: [Config] Fix EnumNode error messages for INF, NAN and enum cases without a backing value
- fix: [Config][Routing] Fix excluded paths in XML route imports and in GlobResource ids
- fix: bug #67960 [Config] Compare resource freshness with cache build start (X-Coder264)
- change: Merge branch '6.4' into 7.4
- change: Merge branch '6.4' into 7.4
- change: Merge branch '6.4' into 7.4
- change: Merge branch '6.4' into 7.4
- change: Merge branch '7.4' into 8.1
- change: Merge branch '7.4' into 8.1
- change: Merge branch '7.4' into 8.1
- change: Merge branch '7.4' into 8.1
- change: Merge branch '8.1' into 8.2
- change: Merge branch '8.1' into 8.2
- change: Merge branch '8.1' into 8.2
- change: Merge branch '8.1' into 8.2
- change: [Config] Compare resource freshness with cache build start
- change: [Config] Compare the content of directory entries modified in the same second as the cache
- change: [Config] Do not treat NAN as a placeholder
- change: [Config] Tell in config references when env vars are resolved at compile time
Written by cca.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 17 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 3bfc2c217acc49c9934d7682199cad295c19c728 — the exact code this score is about.
- Scored under rubric-2026.11.4 — 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.85+preprod-eba6548ac50f.