Skip to content

Commit e10fa2c

Browse files
committed
Set correct language on code blocks
1 parent 49a7378 commit e10fa2c

File tree

10 files changed

+46
-18
lines changed

10 files changed

+46
-18
lines changed

components/dom_crawler.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,9 @@ You can virtually set and get values on the form::
555555
// where "registration" is its own array
556556
$values = $form->getPhpValues();
557557

558-
To work with multi-dimensional fields::
558+
To work with multi-dimensional fields:
559+
560+
.. code-block:: html
559561

560562
<form>
561563
<input name="multi[]"/>

components/intl.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Intl Component
1111
.. caution::
1212

1313
The replacement layer is limited to the ``en`` locale. If you want to use
14-
other locales, you should `install the intl extension`_. There is no conflict
14+
other locales, you should `install the intl extension`_. There is no conflict
1515
between the two because, even if you use the extension, this package can still
1616
be useful to access the ICU data.
1717

@@ -231,9 +231,9 @@ Locales
231231
~~~~~~~
232232

233233
A locale is the combination of a language, a region and some parameters that
234-
define the interface preferences of the user. For example, "Chinese" is the
235-
language and ``zh_Hans_MO`` is the locale for "Chinese" (language) + "Simplified"
236-
(script) + "Macau SAR China" (region). The ``Locales`` class provides access to
234+
define the interface preferences of the user. For example, "Chinese" is the
235+
language and ``zh_Hans_MO`` is the locale for "Chinese" (language) + "Simplified"
236+
(script) + "Macau SAR China" (region). The ``Locales`` class provides access to
237237
the name of all locales::
238238

239239
use Symfony\Component\Intl\Locales;
@@ -351,7 +351,7 @@ translate into any locale with the ``getName()`` method shown earlier::
351351
The reverse lookup is also possible thanks to the ``getCountryCode()`` method,
352352
which returns the code of the country where the given timezone ID belongs to::
353353

354-
$countryCode = Timezones::getCountryCode('America/Vancouver')
354+
$countryCode = Timezones::getCountryCode('America/Vancouver');
355355
// => $countryCode = 'CA' (CA = Canada)
356356

357357
The `UTC/GMT time offsets`_ of all timezones are provided by ``getRawOffset()``

components/serializer.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,9 @@ For example, take an object normalized as following::
901901

902902
['foo' => [1, 2], 'bar' => true];
903903

904-
The ``XmlEncoder`` will encode this object like that::
904+
The ``XmlEncoder`` will encode this object like that:
905+
906+
.. code-block:: xml
905907
906908
<?xml version="1.0" encoding="UTF-8" ?>
907909
<response>

contributing/code/conventions.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,19 @@ after the use declarations, like in this example from
188188

189189
.. _`ServiceRouterLoader`: https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Routing/Loader/DependencyInjection/ServiceRouterLoader.php
190190

191-
The deprecation must be added to the ``CHANGELOG.md`` file of the impacted component::
191+
The deprecation must be added to the ``CHANGELOG.md`` file of the impacted component:
192+
193+
.. code-block:: markdown
192194
193195
4.4
194196
---
195197
196198
* Deprecate the `Deprecated` class, use `Replacement` instead
197199
198200
It must also be added to the ``UPGRADE.md`` file of the targeted minor version
199-
(``UPGRADE-4.4.md`` in our example)::
201+
(``UPGRADE-4.4.md`` in our example):
202+
203+
.. code-block:: markdown
200204
201205
DependencyInjection
202206
-------------------

create_framework/front_controller.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ the ``setContent()`` directly from the front controller script::
185185

186186
// ...
187187

188-
And the ``hello.php`` script can now be converted to a template::
188+
And the ``hello.php`` script can now be converted to a template:
189+
190+
.. code-block:: html+php
189191

190192
<!-- example.com/src/pages/hello.php -->
191193
<?php $name = $request->get('name', 'World') ?>

create_framework/routing.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ framework just a little to make templates even more readable::
3030
$response->send();
3131

3232
As we now extract the request query parameters, simplify the ``hello.php``
33-
template as follows::
33+
template as follows:
34+
35+
.. code-block:: html+php
3436

3537
<!-- example.com/src/pages/hello.php -->
3638
Hello <?= htmlspecialchars(isset($name) ? $name : 'World', ENT_QUOTES, 'UTF-8') ?>
@@ -163,6 +165,8 @@ There are a few new things in the code:
163165

164166
* Request attributes are extracted to keep our templates simple::
165167

168+
.. code-block:: html+php
169+
166170
// example.com/src/pages/hello.php
167171
Hello <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>
168172

reference/configuration/framework.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,9 @@ Since every developer uses a different IDE, the recommended way to enable this
415415
feature is to configure it on a system level. This can be done by setting the
416416
``xdebug.file_link_format`` option in your ``php.ini`` configuration file. The
417417
format to use is the same as for the ``framework.ide`` option, but without the
418-
need to escape the percent signs (``%``) by doubling them::
418+
need to escape the percent signs (``%``) by doubling them:
419+
420+
.. code-block:: ini
419421
420422
// example for PhpStorm
421423
xdebug.file_link_format="phpstorm://open?file=%f&line=%l"
@@ -438,7 +440,9 @@ need to escape the percent signs (``%``) by doubling them::
438440
When running your app in a container or in a virtual machine, you can tell
439441
Symfony to map files from the guest to the host by changing their prefix.
440442
This map should be specified at the end of the URL template, using ``&`` and
441-
``>`` as guest-to-host separators::
443+
``>`` as guest-to-host separators:
444+
445+
.. code-block:: text
442446
443447
// /path/to/guest/.../file will be opened
444448
// as /path/to/host/.../file on the host

setup/homestead.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ Homestead now supports a Symfony 2 and 3 web layout with ``app.php`` and
5858
using type ``symfony4``.
5959

6060
At last, edit the hosts file on your local machine to map ``symfony-demo.test``
61-
to ``192.168.10.10`` (which is the IP used by Homestead)::
61+
to ``192.168.10.10`` (which is the IP used by Homestead):
62+
63+
.. code-block:: text
6264
6365
# /etc/hosts (unix) or C:\Windows\System32\drivers\etc\hosts (Windows)
6466
192.168.10.10 symfony-demo.test

templating/PHP.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ Profiling Templates
332332
~~~~~~~~~~~~~~~~~~~
333333

334334
By using the ``stopwatch`` helper, you are able to time parts of your template
335-
and display it on the timeline of the WebProfilerBundle::
335+
and display it on the timeline of the WebProfilerBundle:
336+
337+
.. code-block:: html+php
336338

337339
<?php $view['stopwatch']->start('foo') ?>
338340
... things that get timed
@@ -347,13 +349,17 @@ Output Escaping
347349
---------------
348350

349351
When using PHP templates, escape variables whenever they are displayed to the
350-
user::
352+
user:
353+
354+
.. code-block:: html+php
351355

352356
<?= $view->escape($var) ?>
353357

354358
By default, the ``escape()`` method assumes that the variable is outputted
355359
within an HTML context. The second argument lets you change the context. For
356-
instance, to output something in a JavaScript script, use the ``js`` context::
360+
instance, to output something in a JavaScript script, use the ``js`` context:
361+
362+
.. code-block:: html+php
357363

358364
<?= $view->escape($var, 'js') ?>
359365

translation.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ PHP Templates
414414
~~~~~~~~~~~~~
415415

416416
The translator service is accessible in PHP templates through the
417-
``translator`` helper::
417+
``translator`` helper:
418+
419+
.. code-block:: html+php
418420

419421
<?= $view['translator']->trans('Symfony is great') ?>
420422

0 commit comments

Comments
 (0)