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

Skip to content

[DependencyInjection][Bug] Cryptic service name with anonymous service as argument #26630

Closed
@dkarlovi

Description

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

While working around #26629, I moved my service into a separate file, like this:

    <services>
        <service parent="liip_imagine.imagick" id="image.imagine">
            <call method="setMetadataReader">
                <argument type="service">
                    <service id="App\Infrastructure\Imagine\Metadata\ExifMetadataReader" lazy="true"/>
                </argument>
            </call>
        </service>
    </services>

This produces a very cryptic error (note the name, also the class is not set, but the ID is):

The definition for "1_~t2jBfn7" has no class. If you intend to inject this service dynamically at runtime, please mark it as synthetic=true. If this is an abstract definition solely used by child definitions, please add abstract=true, otherwise specify a class to get rid of this error.

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