- last update
about 1 year ago Custom Commands Failed - 🇬🇧United Kingdom longwave UK
It turns out that we can just start using the
#[Autowire]
attribute now, and it works out of the box with Symfony 6.2. If autowiring fails the error message is unhelpful, but that is fixed in Symfony 6.3. - last update
about 1 year ago Custom Commands Failed - last update
about 1 year ago 29,023 pass, 100 fail - last update
about 1 year ago 29,349 pass, 15 fail - last update
about 1 year ago 29,366 pass - last update
about 1 year ago 29,366 pass - Status changed to Needs review
about 1 year ago 4:35pm 30 April 2023 - 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
This looks really cool and I use this feature frequently in laravel/symfony projects so I am a big fan.
Since this also already converts a lot of services this would be really helpful to get in but I'm not sure how to review this. If this would be broken in some way this would lead to a lot of broken tests, so seeing that doesn't happen gives a lot of confidence.We should probably add a change record as well?
- Status changed to Needs work
about 1 year ago 6:54pm 17 May 2023 - 🇺🇸United States smustgrave
I agree with the change record.
As someone who hasn't done any symfony project I didn't know what this was so there are sure to be others.
- 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺
📌 Enable more service autowiring by adding interface aliases to core modules Fixed landed!
AFAICT that means this issue can now really move forward!
- 🇧🇷Brazil elber Brazil
Hi I added a basic CR https://www.drupal.org/node/3366757 →
- last update
about 1 year ago Build Successful - @longwave opened merge request.
- Status changed to Needs review
about 1 year ago 6:26pm 16 June 2023 - 🇬🇧United Kingdom longwave UK
Opened a new MR for 11.x, following 📌 Enable more service autowiring by adding interface aliases to core modules Fixed hopefully everyone can see how this can simplify services going forwards. One day I hope we won't even need to write services.yml files in most cases.
- Status changed to Needs work
about 1 year ago 9:35pm 16 June 2023 - 🇮🇹Italy mondrake 🇮🇹
I filed 📌 [policy] Service autowiring - decide approach for multiple service implementations based on the same class and different arguments Needs work . That would help here, by allowing to avoid the need to use
#[Autowire]
for services that have multiple implementations for the same interface (cache bins, loggers, etc). 33:37 32:36 Running- Status changed to Needs review
about 1 year ago 9:14pm 17 June 2023 - 🇬🇧United Kingdom longwave UK
Fixed test failures and autowired some things that were previously missed.
This doesn't yet autowire core.services.yml, perhaps that can be done in a followup.
- last update
about 1 year ago 29,497 pass, 1 fail - last update
about 1 year ago 29,497 pass, 1 fail - 🇺🇸United States smustgrave
Should this be postponed on 📌 [policy] Service autowiring - decide approach for multiple service implementations based on the same class and different arguments Needs work ?
- 🇮🇹Italy mondrake 🇮🇹
#22 no I do not think so. If it's finally agreed that 📌 [policy] Service autowiring - decide approach for multiple service implementations based on the same class and different arguments Needs work is worth doing, then it's probably worth closing it and do what it preaches here, so that all things go together.
- 🇺🇸United States smustgrave
Think the open question on the other ticket needs to be answered first before closing, and I don't think I can make that call. But the question
Given that each module needs its own logger, should we automatically register a logger service for each module, and then autowire LoggerInterface to use the module specific logger with no extra configuration?
- Status changed to RTBC
12 months ago 1:25pm 29 June 2023 - 🇺🇸United States smustgrave
Don't want to hold this up on 📌 [policy] Service autowiring - decide approach for multiple service implementations based on the same class and different arguments Needs work if it's not needed. So lets see what the committers think.
- Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
12 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - Status changed to Needs work
11 months ago 10:19am 9 August 2023 - 🇳🇿New Zealand quietone New Zealand
The issue summary is clear here. Reading the comments I don't see any unanswered question.
#21 suggests a followup. Does that need to be done or not?
The title of the CR is a directive. It reads like custom code must use autowiring. I think that needs a tweak. I read the CR and it seems vague to me. It says to 'remove as many explicit arguments as possible' without direction on what 'possible' means here. I also see in the MR the use of
_defaults: autowire: true
Maybe an example should be added that uses that?
I am setting to NW because the MR needs a rebase.
- last update
11 months ago 29,459 pass - Status changed to Needs review
11 months ago 12:23pm 9 August 2023 - Status changed to Needs work
11 months ago 12:47pm 9 August 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- last update
11 months ago 29,465 pass - last update
11 months ago Custom Commands Failed - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
11 months ago Not currently mergeable. - last update
11 months ago 29,484 pass, 1 fail - last update
11 months ago Custom Commands Failed - last update
10 months ago Custom Commands Failed - Status changed to Needs review
10 months ago 3:04pm 18 August 2023 - 🇬🇧United Kingdom longwave UK
This is getting unwieldy to repeatedly fix merge conflicts; I wonder if we need to rescope this into smaller issues to get them in more easily.
- Status changed to Needs work
10 months ago 2:54pm 20 August 2023 The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺
+1 — what kind of split do you think would work well? 2 parts or more still?
- 🇬🇧United Kingdom longwave UK
One way forward might be to write a test to discover which services could be autowired simply by removing their arguments section (ie. all arguments in the constructor can be autowired without specify attributes), which solves the simple cases, then in a followup we handle the more complicated cases where we need cache backends or loggers to be specified.
- last update
8 months ago Custom Commands Failed - @longwave opened merge request.
- last update
8 months ago 30,436 pass, 1 fail - last update
8 months ago Build Successful - last update
8 months ago Build Successful - last update
8 months ago 30,429 pass, 8 fail - last update
8 months ago 30,439 pass - Status changed to Needs review
8 months ago 11:12am 26 October 2023 - 🇬🇧United Kingdom longwave UK
Rescoping this issue to cover core.services.yml only; the changes are minimal (almost all deletions) except for a new test that ensures we don't specify
arguments
in services.yml where autowiring can suffice.In followups, we can deal with autowiring more of core.services.yml (by either adding more interface aliases, or specifying the #[Autowire] attribute), and autowiring core modules as well.
Updated the change record to match the rescoped approach.
- last update
8 months ago 30,439 pass - last update
8 months ago 30,439 pass - Status changed to RTBC
8 months ago 12:08pm 26 October 2023 - 🇺🇸United States smustgrave
The rescope seems good and definitely simpler to read.
- Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
8 months ago Not currently mergeable. - First commit to issue fork.
- last update
8 months ago 30,520 pass - 🇬🇧United Kingdom longwave UK
Note for reviewers: the changes in LamguageServiceProvider imply that this is not backward compatible for modules that might implement similar service providers to extend or alter core services. I am not sure what we can do about this.
- last update
8 months ago 30,531 pass - last update
8 months ago 30,547 pass, 2 fail - last update
7 months ago 30,575 pass - Status changed to Needs work
7 months ago 5:11pm 17 November 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇺🇸United States mfb San Francisco
re: #38 what is the incompatibility? You no longer have to add an argument that can be autowired, but if you do, it still works, right?
- 🇬🇧United Kingdom longwave UK
language_manager: class: Drupal\Core\Language\LanguageManager arguments: ['@language.default']
public function alter(ContainerBuilder $container) { $definition = $container->getDefinition('language_manager'); $definition->setClass('Drupal\language\ConfigurableLanguageManager') ->addArgument(new Reference('config.factory')) ->addArgument(new Reference('module_handler')) ->addArgument(new Reference('language.config_factory_override')) ->addArgument(new Reference('request_stack'));
IIRC the issue was that if we switch
language_manager
to autowiring but leave the alter hook unchanged,config.factory
becomes the first argument of the new constructor, which is incorrect.