8000 Autowiring skips scalars, confuses order · Issue #17878 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Autowiring skips scalars, confuses order #17878
Closed
@weaverryan

Description

@weaverryan

This somewhat relates to #17724

Take this class:

class ArgumentWithNoTypeHint
{
    public function __construct(A $a, $foo, Lille $l)
    {
    }
}

Currently, since $foo is not type-hinted, it just skips filling it in. Because of this, $definition->getArguments() returns 2 items with indexes 0 and 2. But the container ultimately passes these as arguments 1 and 2. The error here would be:

Argument 3 passed to ArgumentWithNoTypeHint must be an instance of Lille, none given.

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

      0