Skip to content

Always interpret closures as factories #487

@mnapoli

Description

@mnapoli

When a factory is at the root of the definition array, it is automatically interpreted as a factory (DI\factory() is not necessary).

However it's not the case if the closure is in an array or an object parameter.

We could simplify the behavior and always consider a closure as a factory. If a user wants to really inject a closure, DI\value() is here for that. The behavior will at least be more consistent and simple.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions