Repository navigation
#271 - Simplify service loading and replace deprecated prototype() calls in Configuration - #284
Merged
Merged
Conversation
…lls in Configuration
- CleverAgeProcessExtension::findServices() imports the service definition
files with a glob pattern ($loader->import('*.yaml', 'glob')) instead of a
Finder and one load() call per file. Same signature, same files.
- Configuration: arrayPrototype() / variablePrototype() / scalarPrototype()
instead of prototype('array'|'variable'|'scalar'); the @var annotations are
no longer needed. Docblock link updated.
- Test that every service of config/services/*.yaml is registered.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #271.
Changes
CleverAgeProcessExtension::findServices(): imports the service definition files with a glob pattern,$loader->import('*.'.$extension, 'glob'), instead of aFinderand oneYamlFileLoader::load()call per file. Theprotectedmethod keeps its signature (no deprecation needed for subclasses). Note:load()does not resolve glob patterns,import()does (relative to theFileLocatorpath).The old docblock said "Recursively", but files of a sub-directory could not be loaded anyway (
load($file->getFilename())resolved them from the root directory): same files loaded.Configuration:arrayPrototype()/variablePrototype()/scalarPrototype()instead ofprototype('array'|'variable'|'scalar'); the@var ArrayNodeDefinitionannotations are no longer needed (arrayPrototype()is typed). Docblock link updated (Symfony 2 cookbook →bundles/configuration.html).Tests
CleverAgeProcessExtensionTest::testEveryServiceDefinitionFileIsLoaded: every service (and resource prefix) ofconfig/services/*.yamlis registered. Checked that it fails when only part of the files is loaded.YamlReferenceDumperdump of the configuration tree and the list of the registered service ids and aliases are identical.composer update: 904 tests OK, PHPStan, PHP-CS-Fixer, Rector OK.Requirements
Breaking changes
None: same configuration tree, same services, same
findServices()signature.🤖 Generated with Claude Code