Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action constructor dependency injection #301

Closed
chriskapp opened this issue Mar 28, 2020 · 1 comment
Closed

Action constructor dependency injection #301

chriskapp opened this issue Mar 28, 2020 · 1 comment
Labels
Milestone

Comments

@chriskapp
Copy link
Member

Currently if you want to access a service from an action you need to implement the ContainerAwareInterface through this your action receives the complete DI container and can access specific services. This is an anti-pattern since you now use the DI container as service locator. Since our DI container supports now auto-wiring it would be great to support this also for all action/connection and provider implementation. Through this a user could simply create a constructor with the needed dependencies and the DI container resolves them automatically through the type-hint. This would help to develop more clean and testable actions.

@chriskapp chriskapp added this to the 1.9.1 milestone Mar 28, 2020
@chriskapp
Copy link
Member Author

This is now implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant