Not referring to a scalar starting with the indicator symbol β€œ%” is deprecated since Symfony 3.1

All my services and parameters from services.yml are crossed out and I get a message . Not referring to the scalar starting with the indicator symbol β€œ%”, it’s deprecated since Symfony 3.1 " . But I use Symfony 2.6 and I don’t want to put the values ​​in quotation marks, since it is not needed for this version. This happened only after how I updated my Symfony plugin for PhpStorm 2016.1.

What can I do to avoid this? (using PhpStorm 10 or using an older plugin is not an option)

+5
source share
3 answers

What you need to do is use double quotes.

Before:

services: foo.class: class: Foo\Class arguments: - @some.service - %some.parameter% 

After:

 services: foo.class: class: Foo\Class arguments: - "@some.service" - "%some.parameter%" 
+7
source

The inspection you specified is not provided by PhpStorm 2016.1, but by the Symfony Plugin .

As with any other inspection, you can easily turn it off if you press Alt-Enter * or click the yellow lamp that appears at the beginning of the violation line, then select Disable inspection from the Inspection 'Yaml escaped \ in quoted inspection' options submenu.

You can also find this inspection in the Settings / Preference window under Editor β†’ Inspections β†’ Symfony β†’ Twig .


* I use PhpStorm for OSX, and this is the default key combination.

+4
source

starting with "%", deprecated since version 2.8;)

New in Symfony 2.8: YAML Deviations

+1
source

Source: https://habr.com/ru/post/1245976/


All Articles