Erik Viera Olivares
Erik Viera Olivares

Reputation: 51

"The reserved indicator "@" cannot start a plain scalar" -- in YML file. (UPGRADE SYMFONY 2.8 TO SYMFONY 3.0)

Recently, i'm upgrading symfony to 3.0.9 version. When i solvented all version's problems with librarys, i have tried run the command "php bin/console assets:install" or also the command "php bin/console cache:clear", but now i have problems maybe with the sintaxis in YML files:

C:\inetpub\wwwroot\360forfuture>php bin/console a:i


  [Symfony\Component\Config\Exception\FileLoaderLoadException]
  The file "C:\inetpub\wwwroot\360forfuture\src\H360\ResTableBundle/Resources/config/services.yml" does not contain valid YAML in C:\inetpub\wwwroot\360forfuture\src\H360\ResTableBundle/Resources/config/services.yml (which is being imported from "C:\inetpub\wwwr
  oot\360forfuture\app/config\config.yml").



  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
  The file "C:\inetpub\wwwroot\360forfuture\src\H360\ResTableBundle/Resources/config/services.yml" does not contain valid YAML.



  [Symfony\Component\Yaml\Exception\ParseException]
  The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 5 (near "arguments: [%printerserver_port%,%enviroment%,'@doctrine.orm.entity_manager','@request_stack','@reservas.reservas','@general.parametros','@general.establecimi
  entos','@pos.tpv','@swiftmailer.mailer.tablereservation', @templating, @service_container]").

This is part of my YML file:

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: '@ResTableBundle/Resources/config/services.yml'}

#    fos
    - { resource: fos/fos-rest.yml }

#    knp
    - { resource: knp/knp-menu.yml }
    - { resource: knp/knp-paginator.yml }

any idea for replace "@" here ?¿

Upvotes: 0

Views: 595

Answers (1)

Erik Viera Olivares
Erik Viera Olivares

Reputation: 51

Where ever this line, '@swiftmailer.mailer.tablereservation', @templating, @service_container] is, you need quote marks around the templating and service_container arguments. You will probably need to check all of your service files and apply quote marks as needed. And off-topic but if this is a non-trivial project then you should consider creating a new 4.4 (or even 5.2) project and then moving over the relevant portions. You will probably end up wasting a considerable amount of time with your approach especially if some like @'s are slowing you down.

Upvotes: 0

Related Questions