Skip to content

Improve error message for non-autowirable scalar argument #26838

Closed
@Tobion

Description

@Tobion
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4

Current error message for a non-autowirable argument is like

Cannot autowire service "App\MyService": argument "$myarg" of method "__construct()" must have a type-hint or be given a value explicitly.

But when $myarg is already defined like string $myarg then the part "must have a type-hint" is wrong as it already has a type hint. So this part of the error message can be left out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DependencyInjection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions