Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2018 at 10:37 UTC
Updated:
16 Oct 2025 at 15:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottComment #3
alexpottHad to move the fix.
Comment #6
alexpottComment #7
borisson_I only found one nit to pick on this.
The indentation here looks off.
Comment #9
joachim commentedDo you mean the + being on the same line as the closing array bracket?
I'm sure I've seen that before in core for that pattern of adding defaults to an array.
Comment #10
borisson_No, I mean that the items in the array are intented +4 spaces instead of +2.
Comment #11
joachim commentedOh that’s definitely wrong.
Sorry, was doing patch reviews while the baby was keeping me up at night!
Comment #14
bonrita commentedAdding support for ServiceClosureArgument too.
Comment #15
ravi.shankar commentedComment #16
alexpott@bonrita a better way forward here is to review this issue and create a separate issue for ServiceClosureArgument as you've added on something new without updating the issue title or summary. I would have fixed the issue summary and title and left your changes in but commenting out your changes to OptimizedPhpArrayDumper and running OptimizedPhpArrayDumperTest show that the test coverage you've added is not sufficient as the test you've added does not fail.
Anyway, here is a patch the fixes the coding standard errors noted in #7. Perhaps @bonrita can review this issue and open a new issue with a failing test that shows that ServiceClosureArgument is not supported.
Comment #17
bonrita commentedHi @alexpott thanks for the advice. l have created a new issue concerning ServiceClosureArgument.
l will also add a failing test in the patch that goes with that issue.
Comment #24
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #25
borisson_patch in #16 needs a reroll.
Comment #26
manishsaharan commentedRerolled #16 for 10.1.x
Comment #27
borisson_Looks solid, we have test coverage, so now need a change record.
Comment #28
smustgrave commentedComment #29
manishsaharan commentedTried to fix #26.
Comment #34
finneI did a reroll of the patch for 11.x. It should be in the merge request.
Comment #35
finnehide patch files, using merge request
Comment #36
finneComment #37
finneComment #38
znerol commentedAdded a change record. Reroll looks good. Same restrictions apply as in #3108020: Support ServiceClosureArgument in \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::dumpValue:
This feature is not supported in the custom
YamlFileLoaderDrupal is currently using. But for service definitions built programmatically, this patch still brings some benefits.Comment #39
znerol commented(also added a change record)
Comment #40
quietone commentedThe diff no longer applies. Can someone update the MR?
I read the issue summary and comments. All questions have been answered. The only thing I don't see is a failing test.
Comment #42
elberComment #43
smustgrave commentedRan the tests without the fix and got
Symfony\Component\DependencyInjection\Exception\RuntimeException : Unable to dump a service container if a parameter is an object without _serviceId.
Comment #44
quietone commentedChecking back in. I read the IS and the comments since my last comment. I didn't find any unanswered questions.
This time I read the change record. The CR title should be a clue to the reader of what the change is. This title should be more specific, perhaps state what now supports and IteratorArgument. The body itself should, ideally, begin with the benefit of this change and when the benefits will be seen. Because of this I am tagging for CR updates and setting back to needs work. Fortunately, that shouldn't take much time for anyone familiar with this change.
Leaving at RTBC.
Comment #45
kim.pepperUpdated the CR title and description to make it clearer what the benefits of this change are.
Comment #46
kim.pepperMight need reviews of that CR especially whether it allows the !tagged_iterator argument type now 🤔
Comment #47
kim.pepperAdding #3228629: [meta] Bring dependency injection more in line with upstream Symfony component as parent.
Comment #48
longwaveCommitted 8b6814e and pushed to 11.x. Thanks!
Updated the change record to reference 10.3.0 and published it.
Comment #50
znerol commentedI removed the
services.ymlexample from the CR. The!tagged_iteratornotation still doesn't work. This issue here only changed the container array dumper/loader and not the yaml part (see also #38).Attempting to use the
!tagged_iteratornotation results in the following exception:Comment #51
kim.pepper#50 I believe we need #3108309: Support Yaml::PARSE_CUSTOM_TAGS in \Drupal\Component\Serialization\YamlSymfony::decode for the Yaml loader to support it.We need to update our own YamlParser to support it.
Comment #52
kim.pepperAdded #3414208: Add support for tagged_iterator to YamlFileLoader
Comment #54
mrconnerton commentedReroll for 10.5.x for those interested.I'm sorry I uploaded the wrong patch.Comment #55
mrconnerton commentedComment #56
mrconnerton commentedHere is reroll for 10.5.x