Skip to content

#271 - Simplify service loading and replace deprecated prototype() calls in Configuration - #284

Merged
njoubert-cleverage merged 1 commit into
mainfrom
271
Oct 14, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
271

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #271.

Changes

  • CleverAgeProcessExtension::findServices(): imports the service definition files with a glob pattern, $loader->import('*.'.$extension, 'glob'), instead of a Finder and one YamlFileLoader::load() call per file. The protected method keeps its signature (no deprecation needed for subclasses). Note: load() does not resolve glob patterns, import() does (relative to the FileLocator path).
    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 of prototype('array'|'variable'|'scalar'); the @var ArrayNodeDefinition annotations are no longer needed (arrayPrototype() is typed). Docblock link updated (Symfony 2 cookbook → bundles/configuration.html).
  • CHANGELOG (Latest).

Tests

  • New CleverAgeProcessExtensionTest::testEveryServiceDefinitionFileIsLoaded: every service (and resource prefix) of config/services/*.yaml is registered. Checked that it fails when only part of the files is loaded.
  • Before / after comparison (not committed): the YamlReferenceDumper dump of the configuration tree and the list of the registered service ids and aliases are identical.
  • After composer update: 904 tests OK, PHPStan, PHP-CS-Fixer, Rector OK.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: same configuration tree, same services, same findServices() signature.

🤖 Generated with Claude Code

…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>
@njoubert-cleverage
njoubert-cleverage merged commit b1a84ff into main Oct 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DependencyInjection: simplify service loading and replace deprecated prototype() calls in Configuration

1 participant