Problem/Motivation
Following #3394870: Allow controller service wiring via constructor parameter attributes we can autowire many classes in core that extend ControllerBase by deleting the create() method.
This provides a good example for contrib and custom code to follow, and should mean we can delete hundreds of lines of boilerplate code.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3396310
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:
- 11.x
compare
- 3396310-use-autowiring-for
changes, plain diff MR !5214
Comments
Comment #2
mstrelan commented#3394870: Allow controller service wiring via constructor parameter attributes is in so setting to active
Comment #4
longwaveFirst pass at this.
Comment #5
smustgrave commentedSeems to have CC failures.
Comment #8
spokjeComment #9
smustgrave commentedVery neat.
Ran the test-only feature
So check seems good. And deletions didn't break anything. Think we can rely on the tests on this one. Controllers pretty important in the existing tests :)
Comment #11
larowlanCommitted to 11.x
Waiting on second opinion about whether this still qualifies for 10.2.x
Comment #12
longwaveToo late for 10.2.x now, marking as fixed in 11.x.
Comment #13
longwave