Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DependencyInjection] Add support for tagged iterators/locators exclude option to xml and yaml #47902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Oct 18, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

Followup to #44774 .

The previous PR added support for the exclude option to php attributes & php config files, but not xml or yaml, making it impossible to use this feature with those config types.
Also, since the support for this feature was never added to the yaml & xml dumpers, the generated App_KernelDevDebugContainer.xml is actually incorrect (possibly should be considered a bug), eg the following php configuration:

    $services->set(TestExclude::class)
        ->public()
        ->args([
            tagged_iterator('app.test', exclude: TestExclude::class),
        ]);

produces this xml file:

    <service id="App\Service\TestExclude" class="App\Service\TestExclude" public="true">
      <tag name="app.test"/>
      <argument type="tagged_iterator" tag="app.test"/>
    </service>

With this PR, the dumpers are now aware of the exclude option:

    <service id="App\Service\TestExclude" class="App\Service\TestExclude" public="true">
      <tag name="app.test"/>
-     <argument type="tagged_iterator" tag="app.test"/>
+     <argument type="tagged_iterator" tag="app.test" exclude="App\Service\TestExclude"/>
    </service>

@carsonbot carsonbot added this to the 6.2 milestone Oct 18, 2022
@carsonbot carsonbot changed the title [DI] Add support for tagged iterators/locators exclude option to xml and yaml [DependencyInjection] Add support for tagged iterators/locators exclude option to xml and yaml Oct 18, 2022
@HypeMC HypeMC force-pushed the tagged-exclude-with-all-types branch from a166138 to 9afa5c9 Compare October 18, 2022 21:44
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, thanks!

@nicolas-grekas
Copy link
Member

Thank you @HypeMC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants