-4

I am working with Symfony, and I am trying to include a service using services.yml, and I am getting this error:

Parse Error: syntax error, unexpected 'security' (T_STRING), expecting ']'

Everything seems fine. I checked the service I created, and there's nothing wrong with it.

Roddy P. Carbonell
  • 858
  • 1
  • 11
  • 16
  • 1
    self answering is great .. but not for a syntax error –  Feb 13 '18 at 23:19
  • 3
    @rtfm Probably not the best duplicate since the syntax error was in YAML not PHP. I voted to close for the "simple typographical error" reason – Paul Feb 13 '18 at 23:20
  • Next time try a little before asking here. And if you really need to ask, put a piece of code, otherwise you are asking us to do magic. – Elias Soares Feb 13 '18 at 23:20
  • @Paulpro fair call. but it is a php error message –  Feb 13 '18 at 23:20

1 Answers1

-1

The problem was inside the services.yml file itself:

    activity_listener\:
          class: AppBundle\Listener\ActivityListener
          arguments: 
                 ['@security.token_storage']

It is hard to notice at first. I put a \ at the end of activity_listener, and when that became part of PHP, it neutralized the ' that followed.

Roddy P. Carbonell
  • 858
  • 1
  • 11
  • 16