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] Bad error message for unused bind under _defaults #27828

Copy link
Copy link
Closed
@weaverryan

Description

@weaverryan
Issue body actions

Symfony version(s) affected: 3.4

How to reproduce

Bind a value beneath _defaults or _instanceof:

# config/services.yaml
services:
    _defaults:
        # ...
        bind:
            $variableName: 'someValue'

If this bind is not actually used, the error is attached to the last service that the rule was applied to. So, something like:

Unused binding "$variableName" in service ".abstract.instanceof.App\Twig\AppExtension".

A better error would be:

You have a "bind" configured for an argument named $variableName. But, this argument was not found in any of the services it was applied to. The bind may be unused and can be removed. Or, the bind may have a typo.

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.