Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DependencyInjection] support anonymous services as bound defaults #26629

Copy link
Copy link
Closed
@dkarlovi

Description

@dkarlovi
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 4.0

If I do this:

    <services>
        <defaults public="false" autoconfigure="true" autowire="true">
            <bind key="Imagine\Image\ImagineInterface" type="service">
                <service parent="liip_imagine.imagick">
                    <call method="setMetadataReader">
                        <argument type="service">
                            <service id="App\Infrastructure\Imagine\Metadata\ExifMetadataReader" lazy="true"/>
                        </argument>
                    </call>
                </service>
            </bind>
        </defaults>
    </services>

I get Tag "<bind>" with type="service" has no or empty "id" attribute. But it should be possible, no?

I'm trying to do it like this since services with parent can't be in a file with defaults bound:

Bound values on service "foo" cannot be inherited from "defaults" when a "parent" is set. Move your child definitions to a separate file.

This might actually be a bug, not sure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.