April 19, 2016 Javier Eguiluz

In Symfony 2.8 we introduced some YAML deprecations to make configuration files compliant with the YAML spec. In Symfony 3.1 we introduced additional deprecations, some of them needed for the new YAML features which will be explained in an upcoming article.

Deprecated the !!php/object tag¶ The values of the YAML properties can be serialized PHP objects thanks to the special !!php/object tag: 1 2 3 # app/config/config.yml parameters : my_object : '!!php/object:O:27:"AppBundle\Service\MyService":1:{s:1:"b";s:3:"foo";}' In Symfony 3.1 we deprecated the !!php/object tag in favor of the new !php/object tag, which is almost identical but it's prefixed with just one ! character: 1 2 3 # app/config/config.yml parameters : my_object : '!php/object:O:27:"AppBundle\Service\MyService":1:{s:1:"b";s:3:"foo";}'

Deprecated the Dumper::setIndentation() method¶ When using the Yaml component independently from the Symfony framework, you may have used the setIndentation() method to set the number of white spaces added on each indentation level (which is 4 by default). 1 2 3 4 use Symfony\Component\Yaml\Dumper ; $yaml = new Dumper (); $yaml -> setIndentation ( 2 ); In Symfony 3.1 this method is deprecated and it will be removed in Symfony 4.0. Instead, set the indentation level as the constructor argument: 1 2 3 use Symfony\Component\Yaml\Dumper ; $yaml = new Dumper ( 2 );