Problem/Motivation
Add object that uses the FactoryInterface should have dependencies inject via ::create and not ::__construct(). This allows parent classes to change their constructor without breaking any code.
@see https://events.drupal.org/seattle2019/sessions/drupal-9-coming-getting-y...
Example: \Drupal\config_sync\Controller\ConfigSyncController::create
@see https://www.youtube.com/watch?time_continue=1554&v=hN9KjaBvAUk
@see https://www.previousnext.com.au/blog/safely-extending-drupal-8-plugin-cl...
Proposed resolution
Fix subclassing and stop overriding constructors.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | advagg-Fix_subclassing_and_stop_overriding_constructors_in_advagg_mod_Form_SettingsForm-3107175-3-D8.patch | 1.73 KB | thalles |
Comments
Comment #2
thallesFollow a patch.
Comment #3
thallesthe patch #2 have wrong name, follow a new patch
Comment #5
thalles