Skip to content

[DependencyInjection] SyntaxError: The function "custom_func" does not exist around position 1 #29304

Closed
@mishal

Description

@mishal

Symfony version(s) affected: DependencyInjection Component

symfony/dependency-injection dev-master de73079

Description

When using custom expression language function the dumper cannot dump the container. The custom function does not exist (SyntaxError is thrown) even if properly added to the container builder.

Uncaught Symfony\Component\ExpressionLanguage\SyntaxError: The function "custom_func" does not exist around position 1 for expression `custom_func('FOOBAR')`.

How to reproduce
See: https://pastebin.com/DtDW7GK9

Possible Solution

The issue is coming from: https://github.com/symfony/dependency-injection/blob/master/Compiler/InlineServiceDefinitionsPass.php
The analyzed container does not copy expression providers from the original container, https://github.com/symfony/dependency-injection/blob/master/Compiler/InlineServiceDefinitionsPass.php#L53

Additional context

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