Problem/Motivation
Coming out of #3384835: Policy for semantic versioning
Proposed resolution
- Use auto-wiring for services. Some of the code in Mailer.php on this branch is useful.
- Mark these constructors as @internal - they may change in a minor/patch release.
- Create an easier system for plug-in DI??
#3 is a bit of a radical idea, however it could be something like this:
- New class DiPluginBase extending PluginBase
- Protected static variable
$service_idsarray of strings. - Static function
create()gets these services from the container, creates the object, then calls protected functioninject()passing array of services keyed by id. In case of derived classes, combine the arrays from all levels of the class hierarchy. - Protected function
inject()default implementation saves to protected variable$services. - Protected function
service($id)gets the service - just like theDrupal::service()function however with DI. - Net code added to use a new service = add string to an array. No BC impact to derived classes.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork symfony_mailer-3391570
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
adamps commentedComment #3
adamps commentedComment #4
adamps commentedComment #6
adamps commentedComment #8
adamps commented