Problem/Motivation
Drupal utilizes the Symfony service container, however some features such as autowiring and autoconfiguration were not leveraged in Drupal 8. Since Drupal 9.3, services can be autowired. This means that when defining a service in *.services.yml, in many cases the arguments can be automatically inferred from the typehints on constructor arguments. More information on service autowiring in Drupal can be found in the change record.
Proposed resolution
In order for other (custom) modules using services provided by this module to be autowired, aliases needs to be added for classes and non-ambiguous core interfaces (i.e. interfaces that only have a single implementation). It's not required for services of this module to use autowire: true, that would only be possible if the module only supports Drupal 9.3.0 or higher.
Issue fork geocoder-3535459
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
Comment #3
dieterholvoet commentedComment #4
dieterholvoet commentedComment #5
itamair commentedThanks @dieterholvoet ... for providing all this.
Not yet (super) clear to me what all this is already achieving or is setting to make the module ready to achieve,
thus I will need to better go through the parent reference: https://www.drupal.org/node/3218156
But one question from now. Is it not needed the
autowire: trueto enable autowiring, as mentioned inside that?Comment #6
dieterholvoet commentedIt allows other (custom) modules using services provided by this module to be autowired. It's not required for this module to use autowiring, that would only be possible if the module only supports Drupal 9.3.0 or higher.
Comment #7
itamair commentedthanks @dieterholvoet, going to commit/merge this asap ...
Comment #8
itamair commented