Skip to content

Type resolution bug in the autoresolver #231

Description

@far-blue

I stumbled across a bug in the autoresolver. The issue seems to be here:

https://github.com/auraphp/Aura.Di/blob/4.x/src/Resolver/AutoResolver.php#L63

When the constructer parameter has a union type such as "\DateTimeImmutable|string" a ReflectionUnionType instance is instantiated but this class doesn't have a 'getName()' method. I guess from the docs you are supposed to call 'getTypes()' and loop through them to retrieve the actual types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions