Skip to content

Commit abd10ca

Browse files
committed
minor #5992 More use single quotes for YAML strings (snoek09)
This PR was merged into the 2.3 branch. Discussion ---------- More use single quotes for YAML strings | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #5935 Commits ------- e9461ca use single quotes for YAML strings
2 parents 647fdaa + e9461ca commit abd10ca

35 files changed

+78
-78
lines changed

best_practices/i18n.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ following ``translator`` configuration option and set your application locale:
1111
# app/config/config.yml
1212
framework:
1313
# ...
14-
translator: { fallbacks: ["%locale%"] }
14+
translator: { fallbacks: ['%locale%'] }
1515
1616
# app/config/parameters.yml
1717
parameters:

best_practices/templates.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ name is irrelevant because you never use it in your own code):
156156
services:
157157
app.twig.app_extension:
158158
class: AppBundle\Twig\AppExtension
159-
arguments: ["@markdown"]
159+
arguments: ['@markdown']
160160
public: false
161161
tags:
162162
- { name: twig.extension }

book/service_container.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ straightforward. Parameters make defining services more organized and flexible:
209209
services:
210210
my_mailer:
211211
class: Acme\HelloBundle\Mailer
212-
arguments: ["%my_mailer.transport%"]
212+
arguments: ['%my_mailer.transport%']
213213
214214
.. code-block:: xml
215215
@@ -353,7 +353,7 @@ directories don't exist, create them.
353353
services:
354354
my_mailer:
355355
class: Acme\HelloBundle\Mailer
356-
arguments: ["%my_mailer.transport%"]
356+
arguments: ['%my_mailer.transport%']
357357
358358
.. code-block:: xml
359359
@@ -614,7 +614,7 @@ the service container gives you a much more appealing option:
614614
615615
newsletter_manager:
616616
class: Acme\HelloBundle\Newsletter\NewsletterManager
617-
arguments: ["@my_mailer"]
617+
arguments: ['@my_mailer']
618618
619619
.. code-block:: xml
620620
@@ -700,7 +700,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
700700
newsletter_manager:
701701
class: Acme\HelloBundle\Newsletter\NewsletterManager
702702
calls:
703-
- [setMailer, ["@my_mailer"]]
703+
- [setMailer, ['@my_mailer']]
704704
705705
.. code-block:: xml
706706
@@ -762,7 +762,7 @@ it exists and do nothing if it doesn't:
762762
services:
763763
newsletter_manager:
764764
class: Acme\HelloBundle\Newsletter\NewsletterManager
765-
arguments: ["@?my_mailer"]
765+
arguments: ['@?my_mailer']
766766
767767
.. code-block:: xml
768768
@@ -872,7 +872,7 @@ Configuring the service container is easy:
872872
services:
873873
newsletter_manager:
874874
class: Acme\HelloBundle\Newsletter\NewsletterManager
875-
arguments: ["@mailer", "@templating"]
875+
arguments: ['@mailer', '@templating']
876876
877877
.. code-block:: xml
878878

components/dependency_injection/_imports-parameters-note.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# app/config/config.yml
1212
imports:
13-
- { resource: "%kernel.root_dir%/parameters.yml" }
13+
- { resource: '%kernel.root_dir%/parameters.yml' }
1414

1515
.. code-block:: xml
1616

components/dependency_injection/configurators.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,20 @@ The service config for the above classes would look something like this:
139139
140140
email_configurator:
141141
class: EmailConfigurator
142-
arguments: ["@email_formatter_manager"]
142+
arguments: ['@email_formatter_manager']
143143
# ...
144144
145145
newsletter_manager:
146146
class: NewsletterManager
147147
calls:
148148
- [setMailer, ["@my_mailer"]]
149-
configurator: ["@email_configurator", configure]
149+
configurator: ['@email_configurator', configure]
150150
151151
greeting_card_manager:
152152
class: GreetingCardManager
153153
calls:
154-
- [setMailer, ["@my_mailer"]]
155-
configurator: ["@email_configurator", configure]
154+
- [setMailer, ['@my_mailer']]
155+
configurator: ['@email_configurator', configure]
156156
157157
.. code-block:: xml
158158

components/dependency_injection/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ config files:
239239
services:
240240
mailer:
241241
class: Mailer
242-
arguments: ["%mailer.transport%"]
242+
arguments: ['%mailer.transport%']
243243
newsletter_manager:
244244
class: NewsletterManager
245245
calls:

components/dependency_injection/parameters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ the parameter value in one place if needed.
151151

152152
.. code-block:: yaml
153153
154-
arguments: ["http://symfony.com/?foo=%%s&bar=%%d"]
154+
arguments: ['http://symfony.com/?foo=%%s&bar=%%d']
155155
156156
.. code-block:: xml
157157

components/dependency_injection/tags.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ For example you may add the following transports as services:
7474
acme_mailer.transport.smtp:
7575
class: \Swift_SmtpTransport
7676
arguments:
77-
- "%mailer_host%"
77+
- '%mailer_host%'
7878
tags:
7979
- { name: acme_mailer.transport }
8080
acme_mailer.transport.sendmail:
@@ -220,7 +220,7 @@ To answer this, change the service declaration:
220220
acme_mailer.transport.smtp:
221221
class: \Swift_SmtpTransport
222222
arguments:
223-
- "%mailer_host%"
223+
- '%mailer_host%'
224224
tags:
225225
- { name: acme_mailer.transport, alias: foo }
226226
acme_mailer.transport.sendmail:

components/dependency_injection/types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ service container configuration:
4343
# ...
4444
newsletter_manager:
4545
class: NewsletterManager
46-
arguments: ["@my_mailer"]
46+
arguments: ['@my_mailer']
4747
4848
.. code-block:: xml
4949

components/yaml/yaml_format.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ YAML uses indentation with one or more spaces to describe nested collections:
216216

217217
.. code-block:: yaml
218218
219-
"symfony 1.0":
219+
'symfony 1.0':
220220
PHP: 5.0
221221
Propel: 1.2
222-
"symfony 1.2":
222+
'symfony 1.2':
223223
PHP: 5.2
224224
Propel: 1.3
225225
@@ -279,8 +279,8 @@ You can mix and match styles to achieve a better readability:
279279
280280
.. code-block:: yaml
281281
282-
"symfony 1.0": { PHP: 5.0, Propel: 1.2 }
283-
"symfony 1.2": { PHP: 5.2, Propel: 1.3 }
282+
'symfony 1.0': { PHP: 5.0, Propel: 1.2 }
283+
'symfony 1.2': { PHP: 5.2, Propel: 1.3 }
284284
285285
Comments
286286
--------

cookbook/controller/service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ argument:
198198
services:
199199
app.hello_controller:
200200
class: AppBundle\Controller\HelloController
201-
arguments: ["@templating"]
201+
arguments: ['@templating']
202202
203203
.. code-block:: xml
204204

cookbook/doctrine/mongodb_session_storage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ need to change/add some parameters in the main configuration file:
3030
mongo_client:
3131
class: MongoClient
3232
# if using a username and password
33-
arguments: ["mongodb://%mongodb_username%:%mongodb_password%@%mongodb_host%:27017"]
33+
arguments: ['mongodb://%mongodb_username%:%mongodb_password%@%mongodb_host%:27017']
3434
# if not using a username and password
35-
arguments: ["mongodb://%mongodb_host%:27017"]
35+
arguments: ['mongodb://%mongodb_host%:27017']
3636
session.handler.mongo:
3737
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler
38-
arguments: ["@mongo_client", "%mongo.session.options%"]
38+
arguments: ['@mongo_client', '%mongo.session.options%']
3939
4040
.. code-block:: xml
4141

cookbook/doctrine/pdo_session_storage.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To use it, you just need to change some parameters in the main configuration fil
4949
5050
session.handler.pdo:
5151
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
52-
arguments: ["@pdo", "%pdo.db_options%"]
52+
arguments: ['@pdo', '%pdo.db_options%']
5353
5454
.. code-block:: xml
5555
@@ -152,9 +152,9 @@ of your project's data, you can use the connection settings from the
152152
pdo:
153153
class: PDO
154154
arguments:
155-
- "mysql:host=%database_host%;port=%database_port%;dbname=%database_name%"
156-
- "%database_user%"
157-
- "%database_password%"
155+
- 'mysql:host=%database_host%;port=%database_port%;dbname=%database_name%'
156+
- '%database_user%'
157+
- '%database_password%'
158158
159159
.. code-block:: xml
160160

cookbook/event_dispatcher/before_after_filters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ your listener to be called just before any controller is executed.
157157
services:
158158
app.tokens.action_listener:
159159
class: AppBundle\EventListener\TokenListener
160-
arguments: ["%tokens%"]
160+
arguments: ['%tokens%']
161161
tags:
162162
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
163163
@@ -252,7 +252,7 @@ event:
252252
services:
253253
app.tokens.action_listener:
254254
class: AppBundle\EventListener\TokenListener
255-
arguments: ["%tokens%"]
255+
arguments: ['%tokens%']
256256
tags:
257257
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
258258
- { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }

cookbook/form/create_custom_field_type.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ the ``genders`` parameter value as the first argument to its to-be-created
306306
app.form.type.gender:
307307
class: AppBundle\Form\Type\GenderType
308308
arguments:
309-
- "%genders%"
309+
- '%genders%'
310310
tags:
311311
- { name: form.type, alias: gender }
312312

cookbook/form/data_transformers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ it's recognized as a custom field type:
383383
services:
384384
app.type.issue_selector:
385385
class: AppBundle\Form\IssueSelectorType
386-
arguments: ["@doctrine.orm.entity_manager"]
386+
arguments: ['@doctrine.orm.entity_manager']
387387
tags:
388388
- { name: form.type, alias: issue_selector }
389389

cookbook/form/dynamic_form_modification.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ it with :ref:`dic-tags-form-type`.
391391
services:
392392
app.form.friend_message:
393393
class: AppBundle\Form\Type\FriendMessageFormType
394-
arguments: ["@security.context"]
394+
arguments: ['@security.context']
395395
tags:
396396
- { name: form.type, alias: friend_message }
397397

cookbook/logging/channels_handlers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ in all environments, or just ``config_prod.yml`` to happen only in ``prod``:
3939
# log all messages (since debug is the lowest level)
4040
level: debug
4141
type: stream
42-
path: "%kernel.logs_dir%/security.log"
42+
path: '%kernel.logs_dir%/security.log'
4343
channels: [security]
4444
4545
# an example of *not* logging security channel messages for this handler
4646
main:
4747
# ...
48-
# channels: ["!security"]
48+
# channels: ['!security']
4949
5050
.. code-block:: xml
5151
@@ -139,7 +139,7 @@ need to tag your services:
139139
140140
# app/config/config.yml
141141
monolog:
142-
channels: ["foo", "bar"]
142+
channels: ['foo', 'bar']
143143
144144
.. code-block:: xml
145145

cookbook/logging/monolog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ option of your handler to ``rotating_file``:
243243
handlers:
244244
main:
245245
type: rotating_file
246-
path: "%kernel.logs_dir%/%kernel.environment%.log"
246+
path: '%kernel.logs_dir%/%kernel.environment%.log'
247247
level: debug
248248
# max number of log files to keep
249249
# defaults to zero, which means infinite files

cookbook/logging/monolog_email.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ get logged on the server as well as the emails being sent:
162162
members: [streamed, buffered]
163163
streamed:
164164
type: stream
165-
path: "%kernel.logs_dir%/%kernel.environment%.log"
165+
path: '%kernel.logs_dir%/%kernel.environment%.log'
166166
level: debug
167167
buffered:
168168
type: buffer

cookbook/profiler/matchers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ won't use it directly:
113113
services:
114114
app.super_admin_matcher:
115115
class: AppBundle\Profiler\SuperAdminMatcher
116-
arguments: ["@security.context"]
116+
arguments: ['@security.context']
117117
public: false
118118
119119
.. code-block:: xml

cookbook/security/custom_authentication_provider.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ to service ids that do not exist yet: ``wsse.security.authentication.provider``
404404
wsse.security.authentication.provider:
405405
class: AppBundle\Security\Authentication\Provider\WsseProvider
406406
arguments:
407-
- "" # User Provider
408-
- "%kernel.cache_dir%/security/nonces"
407+
- '' # User Provider
408+
- '%kernel.cache_dir%/security/nonces'
409409
public: false
410410
411411
wsse.security.authentication.listener:
412412
class: AppBundle\Security\Firewall\WsseListener
413-
arguments: ["@security.context", "@security.authentication.manager"]
413+
arguments: ['@security.context', '@security.authentication.manager']
414414
public: false
415415
416416
.. code-block:: xml

cookbook/security/remember_me.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
2222
main:
2323
# ...
2424
remember_me:
25-
key: "%secret%"
25+
key: '%secret%'
2626
lifetime: 604800 # 1 week in seconds
2727
path: /
2828
# by default, the feature is enabled by checking a

cookbook/security/securing_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Then in your service configuration, you can inject the service:
7373
services:
7474
newsletter_manager:
7575
class: AppBundle\Newsletter\NewsletterManager
76-
arguments: ["@security.context"]
76+
arguments: ['@security.context']
7777
7878
.. code-block:: xml
7979

cookbook/service_container/scopes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Changing the scope of a service should be done in its definition:
230230
greeting_card_manager:
231231
class: AppBundle\Mail\GreetingCardManager
232232
scope: request
233-
arguments: ["@request"]
233+
arguments: ['@request']
234234
235235
.. code-block:: xml
236236
@@ -304,7 +304,7 @@ The service config for this class would look something like this:
304304
services:
305305
my_mailer:
306306
class: AppBundle\Mail\Mailer
307-
arguments: ["@service_container"]
307+
arguments: ['@service_container']
308308
# scope: container can be omitted as it is the default
309309
310310
.. code-block:: xml

cookbook/session/locale_sticky_session.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Then register the listener:
6969
services:
7070
app.locale_listener:
7171
class: AppBundle\EventListener\LocaleListener
72-
arguments: ["%kernel.default_locale%"]
72+
arguments: ['%kernel.default_locale%']
7373
tags:
7474
- { name: kernel.event_subscriber }
7575
@@ -171,7 +171,7 @@ Then register the listener:
171171
services:
172172
app.user_locale_listener:
173173
class: AppBundle\EventListener\UserLocaleListener
174-
arguments: ["@session"]
174+
arguments: ['@session']
175175
tags:
176176
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
177177

cookbook/web_services/php_soap_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ a ``HelloService`` object properly:
6363
services:
6464
hello_service:
6565
class: Acme\SoapBundle\Services\HelloService
66-
arguments: ["@mailer"]
66+
arguments: ['@mailer']
6767
6868
.. code-block:: xml
6969

0 commit comments

Comments
 (0)