Skip to content

#49 - Add a class alias to autowire the AdapterRegistry - #50

Merged
njoubert-cleverage merged 1 commit into
mainfrom
49
Oct 15, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
49

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #49: the adapter registry can be autowired by its class.

  • config/services/registry.yaml: new private alias CleverAge\CacheProcessBundle\Registry\AdapterRegistry → cleverage_cache_process.registry.adapter (same approach as DependencyInjection: add FQCN aliases and autoconfiguration for TaskInterface and TransformerInterface process-bundle#272). The service id is unchanged.
  • Docs ("Custom cache tasks"): the DeleteTask example is autowired (autowire: true, autoconfigure: true, or the default App\: resource) instead of passing '@cleverage_cache_process.registry.adapter', which is still mentioned for the versions before 2.3.
  • Test: the alias targets the registry and is private, and a compiled container autowires a service depending on AdapterRegistry.
  • CHANGELOG (Latest).

Checks

61 tests OK (also with code coverage, as the CI: no risky test), PHPStan, PHP-CS-Fixer, Rector OK.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: new alias, the cleverage_cache_process.registry.adapter id is unchanged.

🤖 Generated with Claude Code

The CleverAge\CacheProcessBundle\Registry\AdapterRegistry alias (private)
targets the cleverage_cache_process.registry.adapter service, so that the
registry can be autowired, e.g. in a custom cache task extending
AbstractCacheTask declared by the default App\ resource of an application.
The custom task example of the documentation no longer passes the registry
explicitly.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@njoubert-cleverage
njoubert-cleverage merged commit 38d921c into main Oct 15, 2026
18 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.

Add a class alias to autowire the AdapterRegistry

1 participant