8000 use single quotes for YAML strings by snoek09 · Pull Request #5955 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

use single quotes for YAML strings #5955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ the class namespace as a parameter:

services:
app.slugger:
class: "%slugger.class%"
class: '%slugger.class%'

This practice is cumbersome and completely unnecessary for your own services:

Expand Down
2 changes: 1 addition & 1 deletion best_practices/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ configuration to the main routing configuration file:
# app/config/routing.yml
app:
resource: "@AppBundle/Controller/"
resource: '@AppBundle/Controller/'
type: annotation
This configuration will load annotations from any controller stored inside the
Expand Down
10 changes: 5 additions & 5 deletions book/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ format you prefer:
- { resource: security.yml }

framework:
secret: "%secret%"
router: { resource: "%kernel.root_dir%/config/routing.yml" }
secret: '%secret%'
router: { resource: '%kernel.root_dir%/config/routing.yml' }
# ...

# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'

# ...

Expand Down Expand Up @@ -226,7 +226,7 @@ the configuration file for the ``dev`` environment.
- { resource: config.yml }

framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
router: { resource: '%kernel.root_dir%/config/routing_dev.yml' }
profiler: { only_exceptions: false }

# ...
Expand Down
12 changes: 6 additions & 6 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ information. By convention, this information is usually configured in an
# app/config/config.yml
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
driver: '%database_driver%'
host: '%database_host%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'

.. code-block:: xml

Expand Down Expand Up @@ -162,7 +162,7 @@ for you:
doctrine:
dbal:
driver: pdo_sqlite
path: "%kernel.root_dir%/sqlite.db"
path: '%kernel.root_dir%/sqlite.db'
charset: UTF8

.. code-block:: xml
Expand Down
8 changes: 4 additions & 4 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,14 @@ is ``app/config/config.yml``:
# ...

framework:
secret: "%secret%"
secret: '%secret%'
router:
resource: "%kernel.root_dir%/config/routing.yml"
resource: '%kernel.root_dir%/config/routing.yml'
# ...

twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'

# ...

Expand Down
8 changes: 4 additions & 4 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ file:
# app/config/config.yml
framework:
# ...
router: { resource: "%kernel.root_dir%/config/routing.yml" }
router: { resource: '%kernel.root_dir%/config/routing.yml' }

.. code-block:: xml

Expand Down Expand Up @@ -1181,7 +1181,7 @@ configuration:

# app/config/routing.yml
app:
resource: "@AppBundle/Controller/"
resource: '@AppBundle/Controller/'
type: annotation # required to enable the Annotation reader for this resource

.. code-block:: xml
Expand Down Expand Up @@ -1232,7 +1232,7 @@ directory are parsed and put into the routing.

# app/config/routing.yml
app:
resource: "@AcmeOtherBundle/Resources/config/routing.yml"
resource: '@AcmeOtherBundle/Resources/config/routing.yml'

.. code-block:: xml

Expand Down Expand Up @@ -1271,7 +1271,7 @@ suppose you want to prefix all routes in the AppBundle with ``/site`` (e.g.

# app/config/routing.yml
app:
resource: "@AppBundle/Controller/"
resource: '@AppBundle/Controller/'
type: annotation
prefix: /site

Expand Down
8 changes: 4 additions & 4 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ parameter and uses it in the service definition.

# app/config/parameters.yml
parameters:
# This will be parsed as string "@securepass"
mailer_password: "@@securepass"
# This will be parsed as string '@securepass'
mailer_password: '@@securepass'

.. note::

Expand Down Expand Up @@ -398,7 +398,7 @@ configuration.

# app/config/config.yml
imports:
- { resource: "@AcmeHelloBundle/Resources/config/services.yml" }
- { resource: '@AcmeHelloBundle/Resources/config/services.yml' }

.. code-block:: xml

Expand Down Expand Up @@ -475,7 +475,7 @@ invokes the service container extension inside the FrameworkBundle:
secret: xxxxxxxxxx
form: true
csrf_protection: true
router: { resource: "%kernel.root_dir%/config/routing.yml" }
router: { resource: '%kernel.root_dir%/config/routing.yml' }
# ...

.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ not empty, add the following:
AppBundle\Entity\Author:
properties:
name:
- NotBlank: { message: "author.name.not_blank" }
- NotBlank: { message: 'author.name.not_blank' }

.. code-block:: xml

Expand Down
8 changes: 4 additions & 4 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ rules). In order to validate an object, simply map one or more constraints
to its class and then pass it to the ``validator`` service.

Behind the scenes, a constraint is simply a PHP object that makes an assertive
statement. In real life, a constraint could be: "The cake must not be burned".
statement. In real life, a constraint could be: 'The cake must not be burned'.
In Symfony, constraints are similar: they are assertions that a condition
is true. Given a value, a constraint will tell you if that value
adheres to the rules of the constraint.
Expand Down Expand Up @@ -639,7 +639,7 @@ this method must return ``true``:
AppBundle\Entity\Author:
getters:
passwordLegal:
- "True": { message: "The password cannot match your first name" }
- 'True': { message: 'The password cannot match your first name' }

.. code-block:: xml

Expand Down Expand Up @@ -945,8 +945,8 @@ username and the password are different only if all other validation passes
- Strict
getters:
passwordLegal:
- "True":
message: "The password cannot match your username"
- 'True':
message: 'The password cannot match your username'
groups: [Strict]
properties:
username:
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ service by asking for the ``bar`` service like this::
services:
foo:
class: Example\Foo
bar: "@foo"
bar: '@foo'
10 changes: 5 additions & 5 deletions components/dependency_injection/parentservices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ The service config for these classes would look something like this:
newsletter_manager:
class: NewsletterManager
calls:
- [setMailer, ["@my_mailer"]]
- [setEmailFormatter, ["@my_email_formatter"]]
- [setMailer, ['@my_mailer']]
- [setEmailFormatter, ['@my_email_formatter']]

greeting_card_manager:
class: "GreetingCardManager"
class: 'GreetingCardManager'
calls:
- [setMailer, ["@my_mailer"]]
- [setEmailFormatter, ["@my_email_formatter"]]
- [setMailer, ['@my_mailer']]
- [setEmailFormatter, ['@my_email_formatter']]

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Another possibility is just setting public fields of the class directly::
newsletter_manager:
class: NewsletterManager
properties:
mailer: "@my_mailer"
mailer: '@my_mailer'

.. code-block:: xml

Expand Down
6 changes: 3 additions & 3 deletions components/routing/hostname_pattern.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ instance, if you want to match both ``m.example.com`` and
host: "m.{domain}"
defaults:
_controller: AcmeDemoBundle:Main:mobileHomepage
domain: "%domain%"
domain: '%domain%'
requirements:
domain: "%domain%"
domain: '%domain%'

homepage:
path: /
Expand Down Expand Up @@ -246,7 +246,7 @@ You can also set the host option on imported routes:
.. code-block:: yaml

acme_hello:
resource: "@AcmeHelloBundle/Resources/config/routing.yml"
resource: '@AcmeHelloBundle/Resources/config/routing.yml'
host: "hello.example.com"

.. code-block:: xml
Expand Down
6 changes: 3 additions & 3 deletions cookbook/assetic/yuicompressor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ stylesheets:

# app/config/config.yml
assetic:
# java: "/usr/bin/java"
# java: '/usr/bin/java'
filters:
yui_css:
jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
yui_js:
jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ The end user can provide values in any configuration file:

# app/config/config.yml
parameters:
acme_blog.author.email: "fabien@example.com"
acme_blog.author.email: 'fabien@example.com'

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ this code and changing the environment string.

doctrine:
dbal:
logging: "%kernel.debug%"
logging: '%kernel.debug%'
# ...

.. code-block:: xml
Expand Down
4 changes: 2 additions & 2 deletions cookbook/configuration/external_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ You can now reference these parameters wherever you need them.
dbal:
driver pdo_mysql
dbname: symfony_project
user: "%database.user%"
password: "%database.password%"
user: '%database.user%'
password: '%database.password%'

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ the ``extra.symfony-web-dir`` option in the ``composer.json`` file:
# ...
assetic:
# ...
read_from: "%kernel.root_dir%/../../public_html"
read_from: '%kernel.root_dir%/../../public_html'

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/using_parameters_in_dic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Now, examine the results to see this closely:
# true, as expected

my_bundle:
logging: "%kernel.debug%"
logging: '%kernel.debug%'
# true/false (depends on 2nd parameter of AppKernel),
# as expected, because %kernel.debug% inside configuration
# gets evaluated before being passed to the extension
Expand Down
4 changes: 2 additions & 2 deletions cookbook/console/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ First configure a listener for console exception events in the service container
kernel.listener.command_dispatch:
class: AppBundle\EventListener\ConsoleExceptionListener
arguments:
logger: "@logger"
logger: '@logger'
tags:
- { name: kernel.event_listener, event: console.exception }

Expand Down Expand Up @@ -185,7 +185,7 @@ First configure a listener for console terminate events in the service container
kernel.listener.command_dispatch:
class: AppBundle\EventListener\ErrorLoggerListener
arguments:
logger: "@logger"
logger: '@logger'
tags:
- { name: kernel.event_listener, event: console.terminate }

Expand Down
2 changes: 1 addition & 1 deletion cookbook/deployment/heroku.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ change the value of ``path`` from
# ...
nested:
# ...
path: "php://stderr"
path: 'php://stderr'

Once the application is deployed, run ``heroku logs --tail`` to keep the
stream of logs from Heroku open in your terminal.
Expand Down
12 changes: 6 additions & 6 deletions cookbook/deployment/platformsh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ Platform.sh how to deploy your application (read more about
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
database: "mysql:mysql"
database: 'mysql:mysql'

# The configuration of app when it is exposed to the web.
web:
# The public directory of the app, relative to its root.
document_root: "/web"
document_root: '/web'
# The front-controller script to send non-static requests to.
passthru: "/app.php"
passthru: '/app.php'

# The size of the persistent disk of the application (in MB).
disk: 2048

# The mounts that will be performed when the package is deployed.
mounts:
"/app/cache": "shared:files/cache"
"/app/logs": "shared:files/logs"
'/app/cache': 'shared:files/cache'
'/app/logs': 'shared:files/logs'

# The hooks that will be performed when the package is deployed.
hooks:
Expand All @@ -82,7 +82,7 @@ your Git repository which contains the following files:
"http://{default}/":
type: upstream
# the first part should be your project name
upstream: "myphpproject:php"
upstream: 'myphpproject:php'

.. code-block:: yaml

Expand Down
Loading
0