Skip to content

Bug with class_alias #156

@enumag

Description

@enumag
  • bug report? yes
  • feature request? no
  • version: 2.4.8

Description

Nette/DI seems to be incompatible with class aliases. My tests are failing with this error:

[Nette\DI\ServiceCreationException] Service 'arachne.forms.twig.extension.translation': Case mismatch on class name 'Twig\NodeVisitor\NodeVisitorInterface', correct name is 'Twig_NodeVisitorInterface'.

Obviously there is no case mismatch. It's just that Twig\NodeVisitor\NodeVisitorInterface is an alias of Twig_NodeVisitorInterface which confuses ContainerBuilder::checkCase().

Steps To Reproduce

Create a class and an alias to that class. Add it to DIC as service. Try to autowire it into another service using the alias instead of the base class. EDIT: See the test case in my PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions