Skip to content

Use DI service locator for custom repository instantiation#1983

Open
guillaume-sainthillier wants to merge 1 commit intoFriendsOfSymfony:masterfrom
guillaume-sainthillier:claude/di-custom-repositories-08ipr
Open

Use DI service locator for custom repository instantiation#1983
guillaume-sainthillier wants to merge 1 commit intoFriendsOfSymfony:masterfrom
guillaume-sainthillier:claude/di-custom-repositories-08ipr

Conversation

@guillaume-sainthillier
Copy link
Copy Markdown

Instead of constructing custom repositories with new in RepositoryManager, register them as autowired DI services and resolve them through a ServiceLocator. This allows custom repositories to have additional dependencies injected by the container.

Instead of constructing custom repositories with `new` in
RepositoryManager, register them as autowired DI services and
resolve them through a ServiceLocator. This allows custom
repositories to have additional dependencies injected by the
container.

https://claude.ai/code/session_01JCaqk3ppHpZ2EBNbLuV5aD
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.

2 participants