Closed (fixed)
Project:
Domain
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2025 at 11:03 UTC
Updated:
6 Nov 2025 at 14:24 UTC
Jump to comment: Most recent
Services have boilerplate code that is being removed throughout Drupal
Use constructor property promotion to reduce boilerplate, see https://www.drupal.org/project/drupal/issues/3278431
None
None
None
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 #3
idebr commentedThe merge request implements constructor property promotion to reduce boilerplate
Comment #5
idebr commentedControllers that extend ControllerBase cannot promote the properties defined in ControllerBase.
The documentation for ControllerBase suggests it is used for simple cases only, so it might be worth dropping the base class to improve maintainability. Maybe in a follow-up issue?
See ControllerBase docblock: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
Comment #6
mably commentedOk, let's merge it as is for now 👍
Comment #8
mably commentedComment #10
idebr commentedA follow-up to remove ControllerBase for complex use cases is available at #3554044: Remove ControllerBase for complex use cases