Closed (duplicate)
Project:
Drupal core
Version:
9.0.x-dev
Component:
update.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2020 at 05:59 UTC
Updated:
25 Jan 2020 at 10:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hardik_patel_12 commentedKindly review a new patch.
Comment #3
hardik_patel_12 commentedComment #5
hardik_patel_12 commentedKindly review a new patch.
Comment #6
hardik_patel_12 commentedComment #7
longwaveThank you for these patches, but I think that making these changes per file is going to take a long time and a lot of effort.
In #2729597: [meta] Replace \Drupal with injected services where appropriate in core it was suggested that we perhaps make these sorts of replacement on a per service basis - I wonder if you have read that issue and could help out with this type of change over there?
Comment #8
alexpott@longwave good call on scope. I'm not sure about the per service basis as classes often need multiple injections. Here's another suggestion...
@Hardik_Patel_12 thanks for filing this patch. Fixing dependency inject on a class by class basis is going to be quite painful. Please read https://www.drupal.org/core/scope - I think a good scope here would be to combine this with #3107003: \Drupal calls should be avoided in classes, use dependency injection instead in core/modules/update/src/Form classes and do all the injection necessary in core/modules/update/src/Form - there are three forms to update there.
So I'm going to close this as a duplicate of #3107003: \Drupal calls should be avoided in classes, use dependency injection instead in core/modules/update/src/Form classes as that has further instructions on how to do this and respect our BC promise.