Skip to content

Commit 0a3acae

Browse files
committed
minor #5955 use single quotes for YAML strings (snoek09)
This PR was squashed before being merged into the 2.3 branch (closes #5955). Discussion ---------- use single quotes for YAML strings | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #5935 Commits ------- 81b96b6 use single quotes for YAML strings
2 parents e48c528 + 81b96b6 commit 0a3acae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+125
-125
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ the class namespace as a parameter:
145145
146146
services:
147147
app.slugger:
148-
class: "%slugger.class%"
148+
class: '%slugger.class%'
149149
150150
This practice is cumbersome and completely unnecessary for your own services:
151151

best_practices/controllers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ configuration to the main routing configuration file:
4343
4444
# app/config/routing.yml
4545
app:
46-
resource: "@AppBundle/Controller/"
46+
resource: '@AppBundle/Controller/'
4747
type: annotation
4848
4949
This configuration will load annotations from any controller stored inside the

book/configuration.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ format you prefer:
2121
- { resource: security.yml }
2222
2323
framework:
24-
secret: "%secret%"
25-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
24+
secret: '%secret%'
25+
router: { resource: '%kernel.root_dir%/config/routing.yml' }
2626
# ...
2727
2828
# Twig Configuration
2929
twig:
30-
debug: "%kernel.debug%"
31-
strict_variables: "%kernel.debug%"
30+
debug: '%kernel.debug%'
31+
strict_variables: '%kernel.debug%'
3232
3333
# ...
3434
@@ -226,7 +226,7 @@ the configuration file for the ``dev`` environment.
226226
- { resource: config.yml }
227227
228228
framework:
229-
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
229+
router: { resource: '%kernel.root_dir%/config/routing_dev.yml' }
230230
profiler: { only_exceptions: false }
231231
232232
# ...

book/doctrine.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ information. By convention, this information is usually configured in an
6464
# app/config/config.yml
6565
doctrine:
6666
dbal:
67-
driver: "%database_driver%"
68-
host: "%database_host%"
69-
dbname: "%database_name%"
70-
user: "%database_user%"
71-
password: "%database_password%"
67+
driver: '%database_driver%'
68+
host: '%database_host%'
69+
dbname: '%database_name%'
70+
user: '%database_user%'
71+
password: '%database_password%'
7272
7373
.. code-block:: xml
7474
@@ -162,7 +162,7 @@ for you:
162162
doctrine:
163163
dbal:
164164
driver: pdo_sqlite
165-
path: "%kernel.root_dir%/sqlite.db"
165+
path: '%kernel.root_dir%/sqlite.db'
166166
charset: UTF8
167167
168168
.. code-block:: xml

book/page_creation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,14 @@ is ``app/config/config.yml``:
477477
# ...
478478
479479
framework:
480-
secret: "%secret%"
480+
secret: '%secret%'
481481
router:
482-
resource: "%kernel.root_dir%/config/routing.yml"
482+
resource: '%kernel.root_dir%/config/routing.yml'
483483
# ...
484484
485485
twig:
486-
debug: "%kernel.debug%"
487-
strict_variables: "%kernel.debug%"
486+
debug: '%kernel.debug%'
487+
strict_variables: '%kernel.debug%'
488488
489489
# ...
490490

book/routing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ file:
168168
# app/config/config.yml
169169
framework:
170170
# ...
171-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
171+
router: { resource: '%kernel.root_dir%/config/routing.yml' }
172172
173173
.. code-block:: xml
174174
@@ -1181,7 +1181,7 @@ configuration:
11811181
11821182
# app/config/routing.yml
11831183
app:
1184-
resource: "@AppBundle/Controller/"
1184+
resource: '@AppBundle/Controller/'
11851185
type: annotation # required to enable the Annotation reader for this resource
11861186
11871187
.. code-block:: xml
@@ -1232,7 +1232,7 @@ directory are parsed and put into the routing.
12321232
12331233
# app/config/routing.yml
12341234
app:
1235-
resource: "@AcmeOtherBundle/Resources/config/routing.yml"
1235+
resource: '@AcmeOtherBundle/Resources/config/routing.yml'
12361236
12371237
.. code-block:: xml
12381238
@@ -1271,7 +1271,7 @@ suppose you want to prefix all routes in the AppBundle with ``/site`` (e.g.
12711271
12721272
# app/config/routing.yml
12731273
app:
1274-
resource: "@AppBundle/Controller/"
1274+
resource: '@AppBundle/Controller/'
12751275
type: annotation
12761276
prefix: /site
12771277

book/service_container.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ parameter and uses it in the service definition.
259259
260260
# app/config/parameters.yml
261261
parameters:
262-
# This will be parsed as string "@securepass"
263-
mailer_password: "@@securepass"
262+
# This will be parsed as string '@securepass'
263+
mailer_password: '@@securepass'
264264
265265
.. note::
266266

@@ -398,7 +398,7 @@ configuration.
398398
399399
# app/config/config.yml
400400
imports:
401-
- { resource: "@AcmeHelloBundle/Resources/config/services.yml" }
401+
- { resource: '@AcmeHelloBundle/Resources/config/services.yml' }
402402
403403
.. code-block:: xml
404404
@@ -475,7 +475,7 @@ invokes the service container extension inside the FrameworkBundle:
475475
secret: xxxxxxxxxx
476476
form: true
477477
csrf_protection: true
478-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
478+
router: { resource: '%kernel.root_dir%/config/routing.yml' }
479479
# ...
480480
481481
.. code-block:: xml

book/translation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ not empty, add the following:
615615
AppBundle\Entity\Author:
616616
properties:
617617
name:
618-
- NotBlank: { message: "author.name.not_blank" }
618+
- NotBlank: { message: 'author.name.not_blank' }
619619
620620
.. code-block:: xml
621621

book/validation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ rules). In order to validate an object, simply map one or more constraints
302302
to its class and then pass it to the ``validator`` service.
303303

304304
Behind the scenes, a constraint is simply a PHP object that makes an assertive
305-
statement. In real life, a constraint could be: "The cake must not be burned".
305+
statement. In real life, a constraint could be: 'The cake must not be burned'.
306306
In Symfony, constraints are similar: they are assertions that a condition
307307
is true. Given a value, a constraint will tell you if that value
308308
adheres to the rules of the constraint.
@@ -639,7 +639,7 @@ this method must return ``true``:
639639
AppBundle\Entity\Author:
640640
getters:
641641
passwordLegal:
642-
- "True": { message: "The password cannot match your first name" }
642+
- 'True': { message: 'The password cannot match your first name' }
643643
644644
.. code-block:: xml
645645
@@ -945,8 +945,8 @@ username and the password are different only if all other validation passes
945945
- Strict
946946
getters:
947947
passwordLegal:
948-
- "True":
949-
message: "The password cannot match your username"
948+
- 'True':
949+
message: 'The password cannot match your username'
950950
groups: [Strict]
951951
properties:
952952
username:

components/dependency_injection/advanced.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ service by asking for the ``bar`` service like this::
128128
services:
129129
foo:
130130
class: Example\Foo
131-
bar: "@foo"
131+
bar: '@foo'

components/dependency_injection/parentservices.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ The service config for these classes would look something like this:
6363
newsletter_manager:
6464
class: NewsletterManager
6565
calls:
66-
- [setMailer, ["@my_mailer"]]
67-
- [setEmailFormatter, ["@my_email_formatter"]]
66+
- [setMailer, ['@my_mailer']]
67+
- [setEmailFormatter, ['@my_email_formatter']]
6868
6969
greeting_card_manager:
70-
class: "GreetingCardManager"
70+
class: 'GreetingCardManager'
7171
calls:
72-
- [setMailer, ["@my_mailer"]]
73-
- [setEmailFormatter, ["@my_email_formatter"]]
72+
- [setMailer, ['@my_mailer']]
73+
- [setEmailFormatter, ['@my_email_formatter']]
7474
7575
.. code-block:: xml
7676

components/dependency_injection/types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Another possibility is just setting public fields of the class directly::
199199
newsletter_manager:
200200
class: NewsletterManager
201201
properties:
202-
mailer: "@my_mailer"
202+
mailer: '@my_mailer'
203203
204204
.. code-block:: xml
205205

components/routing/hostname_pattern.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ instance, if you want to match both ``m.example.com`` and
183183
host: "m.{domain}"
184184
defaults:
185185
_controller: AcmeDemoBundle:Main:mobileHomepage
186-
domain: "%domain%"
186+
domain: '%domain%'
187187
requirements:
188-
domain: "%domain%"
188+
domain: '%domain%'
189189
190190
homepage:
191191
path: /
@@ -246,7 +246,7 @@ You can also set the host option on imported routes:
246246
.. code-block:: yaml
247247
248248
acme_hello:
249-
resource: "@AcmeHelloBundle/Resources/config/routing.yml"
249+
resource: '@AcmeHelloBundle/Resources/config/routing.yml'
250250
host: "hello.example.com"
251251
252252
.. code-block:: xml

cookbook/assetic/yuicompressor.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ stylesheets:
3333
3434
# app/config/config.yml
3535
assetic:
36-
# java: "/usr/bin/java"
36+
# java: '/usr/bin/java'
3737
filters:
3838
yui_css:
39-
jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
39+
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
4040
yui_js:
41-
jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
41+
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
4242
4343
.. code-block:: xml
4444

cookbook/bundles/best_practices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ The end user can provide values in any configuration file:
342342
343343
# app/config/config.yml
344344
parameters:
345-
acme_blog.author.email: "[email protected]"
345+
acme_blog.author.email: '[email protected]'
346346
347347
.. code-block:: xml
348348

cookbook/configuration/environments.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ this code and changing the environment string.
190190
191191
doctrine:
192192
dbal:
193-
logging: "%kernel.debug%"
193+
logging: '%kernel.debug%'
194194
# ...
195195
196196
.. code-block:: xml

cookbook/configuration/external_parameters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ You can now reference these parameters wherever you need them.
7070
dbal:
7171
driver pdo_mysql
7272
dbname: symfony_project
73-
user: "%database.user%"
74-
password: "%database.password%"
73+
user: '%database.user%'
74+
password: '%database.password%'
7575
7676
.. code-block:: xml
7777

cookbook/configuration/override_dir_structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ the ``extra.symfony-web-dir`` option in the ``composer.json`` file:
130130
# ...
131131
assetic:
132132
# ...
133-
read_from: "%kernel.root_dir%/../../public_html"
133+
read_from: '%kernel.root_dir%/../../public_html'
134134
135135
.. code-block:: xml
136136

cookbook/configuration/using_parameters_in_dic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Now, examine the results to see this closely:
3636
# true, as expected
3737
3838
my_bundle:
39-
logging: "%kernel.debug%"
39+
logging: '%kernel.debug%'
4040
# true/false (depends on 2nd parameter of AppKernel),
4141
# as expected, because %kernel.debug% inside configuration
4242
# gets evaluated before being passed to the extension

cookbook/console/logging.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ First configure a listener for console exception events in the service container
8787
kernel.listener.command_dispatch:
8888
class: AppBundle\EventListener\ConsoleExceptionListener
8989
arguments:
90-
logger: "@logger"
90+
logger: '@logger'
9191
tags:
9292
- { name: kernel.event_listener, event: console.exception }
9393
@@ -185,7 +185,7 @@ First configure a listener for console terminate events in the service container
185185
kernel.listener.command_dispatch:
186186
class: AppBundle\EventListener\ErrorLoggerListener
187187
arguments:
188-
logger: "@logger"
188+
logger: '@logger'
189189
tags:
190190
- { name: kernel.event_listener, event: console.terminate }
191191

cookbook/deployment/heroku.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ change the value of ``path`` from
4545
# ...
4646
nested:
4747
# ...
48-
path: "php://stderr"
48+
path: 'php://stderr'
4949
5050
Once the application is deployed, run ``heroku logs --tail`` to keep the
5151
stream of logs from Heroku open in your terminal.

cookbook/deployment/platformsh.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ Platform.sh how to deploy your application (read more about
4848
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
4949
# side is in the form `<service name>:<endpoint name>`.
5050
relationships:
51-
database: "mysql:mysql"
51+
database: 'mysql:mysql'
5252
5353
# The configuration of app when it is exposed to the web.
5454
web:
5555
# The public directory of the app, relative to its root.
56-
document_root: "/web"
56+
document_root: '/web'
5757
# The front-controller script to send non-static requests to.
58-
passthru: "/app.php"
58+
passthru: '/app.php'
5959
6060
# The size of the persistent disk of the application (in MB).
6161
disk: 2048
6262
6363
# The mounts that will be performed when the package is deployed.
6464
mounts:
65-
"/app/cache": "shared:files/cache"
66-
"/app/logs": "shared:files/logs"
65+
'/app/cache': 'shared:files/cache'
66+
'/app/logs': 'shared:files/logs'
6767
6868
# The hooks that will be performed when the package is deployed.
6969
hooks:
@@ -82,7 +82,7 @@ your Git repository which contains the following files:
8282
"http://{default}/":
8383
type: upstream
8484
# the first part should be your project name
85-
upstream: "myphpproject:php"
85+
upstream: 'myphpproject:php'
8686
8787
.. code-block:: yaml
8888

0 commit comments

Comments
 (0)