Problem/Motivation

ConfigFormBase's constructor:

  public function __construct(
    ConfigFactoryInterface $config_factory,
    protected TypedConfigManagerInterface $typedConfigManager,
  ) {
    $this->setConfigFactory($config_factory);
  }

This means that all subclasses also need to inject those two dependencies and pass them on.

Now we have setter injection via #[Required] perhaps it's simpler to use this in base class dependencies, so forms only have to consider their own dependencies in the constructor?

#3558306: Support automatic setter injection using the #[Required] attribute in AutowireTrait/AutowiredInstanceTrait

Steps to reproduce

Proposed resolution

Inject the config factory and typed config manager via #[Required]
Deprecate the need to pass these to the base constructor

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3586565

Command icon 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

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs work