March 2, 2016 Javier Eguiluz

The upcoming Symfony 3.1 version will introduce lots of new and useful features for the Yaml component. But before enjoying those features, in Symfony 2.8 we needed to deprecate some features to make Yaml files comply with the Yaml specification. Make sure to fix all these changes before upgrading your applications to Symfony 3.

Deprecated non-escaped \ in double-quoted strings¶ This deprecation is common when defining the classes of the services: 1 2 3 app.user_manager: class: "AppBundle\Manager\UserManager" # ... The alternative is either remove the double quotes or escape the \ backslash doubling it: 1 2 3 4 5 6 app.user_manager : # remove double quotes... class : AppBundle\Manager\UserManager # ...or escape backslashes class : "AppBundle\\Manager\\UserManager" # ...

Deprecated usage of @ at the beginning of unquoted strings¶ This deprecation has a big impact because lots of services use the @service_id notation to define their dependencies: 1 2 3 app.user_manager: # ... arguments: [@router, @logger, @doctrine.orm.entity_manager] According to Yaml specification, unquoted strings cannot start with @ , so you must wrap these arguments with single or double quotes: 1 2 3 app.user_manager : # ... arguments : [ '@router' , '@logger' , '@doctrine.orm.entity_manager' ]