Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ExpressionLanguage]: Lexer should provide information to malformed file and/or expression on SyntaxError #19445

Description

@k0pernikus

If a malformed expression syntax is provided in a yaml service config, e.g:

http.request_factory:
    class: Dreamlines\Http\RequestFactory
    arguments:
        - '@ba.endpoint_provider'
        - "@=service(rba.context.factory').create()"

(The r should be a ')

The SyntaxError looks like:

[Symfony\Component\ExpressionLanguage\SyntaxError]  
Unexpected character "'" around position 36. 

There's no information provided what file caused the error, nor the line, nor the faulty expression is echoed so I had to start a xdebug session to find out the yml file in error.

I would have expected the information to read like:

[Symfony\Component\ExpressionLanguage\SyntaxError]  
Unexpected character "'" around position 36 in expression "@=service(rba.context.factory').create()" in "path/to/my/service.yml" on line 39.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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