-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use dependency injection #16
Comments
@wimleers Naive question: is there any major difference that you are aware of between Symphony and Drupal services/dependency injection. |
Drupal == Symfony in this regard. |
I've done some cursory research from what I can tell it makes the most sense to implement the service in CloudFlare rather than PHPSDK due to the dependencies on CMI. |
Merged code in |
Business Requirements
Technical Requirements
Background
This module currently very much uses a D7 pattern, of using
\Drupal::config()
(~variable_get()
) and then instantiating objects all over the place.Instead of exposing services that have their configuration injected, and those services can then be injected again, without every piece of code needing to retrieve the configuration and instantiate such an object again with that configuration.
Clear example of this: https://github.com/wimleers/cloudflare/commit/3281a7d74033b3ee2ab13834cd2bf24e327c62bc#diff-a35ab1b58293fa8fcf5e19b41a5f79e8L104.
The text was updated successfully, but these errors were encountered: