Skip to content

Commit f15031e

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: [Validator] Remove extra space [Validator] Remove empty line from annotation Enhancement: Add new rule "string_replacement" Minor Use integer type instead of int & boolean instead of bool Replace bool by boolean Use integer typehint instead int Tweak Fix a typo on Messenger handler results example Tweak Throw Exception if twig variable is not found add html extension to snake_case recommendation examples Minor: Fix namespace Minor: Fix namespace Update mailer.rst Use int type instead integer Remove simple quotes in config/routes/annotations.yaml
2 parents 2a4924b + a241baf commit f15031e

16 files changed

+24
-20
lines changed

.doctor-rst.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ rules:
3434
short_array_syntax: ~
3535
space_between_label_and_link_in_doc: ~
3636
space_between_label_and_link_in_ref: ~
37+
string_replacement: ~
3738
typo: ~
3839
unused_links: ~
3940
use_deprecated_directive_instead_of_versionadded: ~

mailer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ arguments to the filter:
623623

624624
.. code-block:: html+twig
625625

626-
{% apply inline_css(source('@css/email.css')) %}
626+
{% apply inline_css(source('@styles/email.css')) %}
627627
<h1>Welcome {{ username }}!</h1>
628628
{# ... #}
629629
{% endapply %}

messenger/handler_results.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ handler is registered. The ``HandleTrait`` can be used in any class that has a
6262
}
6363

6464
// Creating such a method is optional, but allows type-hinting the result
65-
private function query(ListItemsQuery $query): ListItemsResult
65+
private function query(ListItemsQuery $query): ListItemsQueryResult
6666
{
6767
return $this->handle($query);
6868
}

reference/configuration/framework.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ outgoing network interface.
860860
buffer
861861
......
862862

863-
**type**: ``bool`` | ``Closure``
863+
**type**: ``boolean`` | ``Closure``
864864

865865
Buffering the response means that you can access its content multiple times
866866
without performing the request again. Buffering is enabled by default when the
@@ -3045,7 +3045,7 @@ Name of the workflow you want to create.
30453045
audit_trail
30463046
"""""""""""
30473047

3048-
**type**: ``bool``
3048+
**type**: ``boolean``
30493049

30503050
If set to ``true``, the :class:`Symfony\\Component\\Workflow\\EventListener\\AuditTrailListener`
30513051
will be enabled.

reference/configuration/twig.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ no specific character is passed as argument to the ``number_format`` filter.
294294
optimizations
295295
~~~~~~~~~~~~~
296296

297-
**type**: ``int`` **default**: ``-1``
297+
**type**: ``integer`` **default**: ``-1``
298298

299299
Twig includes an extension called ``optimizer`` which is enabled by default in
300300
Symfony applications. This extension analyzes the templates to optimize them
@@ -358,6 +358,8 @@ the directory defined in the :ref:`default_path option <config-twig-default-path
358358
359359
Read more about :ref:`template directories and namespaces <templates-namespaces>`.
360360

361+
.. _config-twig-strict-variables:
362+
361363
strict_variables
362364
~~~~~~~~~~~~~~~~
363365

reference/constraints/AtLeastOneOf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ has to be satisfied in order for the validation to succeed.
163163
includeInternalMessages
164164
~~~~~~~~~~~~~~~~~~~~~~~
165165

166-
**type**: ``bool`` **default**: ``true``
166+
**type**: ``boolean`` **default**: ``true``
167167

168168
If set to ``true``, the message that is shown if the validation fails,
169169
will include the list of messages for the internal constraints. See option

reference/constraints/DivisibleBy.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ The following constraints ensure that:
3939
4040
class Item
4141
{
42-
4342
/**
4443
* @Assert\DivisibleBy(0.25)
4544
*/

reference/constraints/Hostname.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Parameter Description
122122
``requireTld``
123123
~~~~~~~~~~~~~~
124124

125-
**type**: ``bool`` **default**: ``true``
125+
**type**: ``boolean`` **default**: ``true``
126126

127127
By default, hostnames are considered valid only when they are fully qualified
128128
and include their TLDs (top-level domain names). For instance, ``example.com``

reference/constraints/Isbn.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ on an object that will contain an ISBN.
3737
/**
3838
* @Assert\Isbn(
3939
* type = "isbn10",
40-
* message = "This value is not valid."
40+
* message = "This value is not valid."
4141
* )
4242
*/
4343
protected $isbn;
@@ -51,7 +51,7 @@ on an object that will contain an ISBN.
5151
isbn:
5252
- Isbn:
5353
type: isbn10
54-
message: This value is not valid.
54+
message: This value is not valid.
5555
5656
.. code-block:: xml
5757
@@ -65,7 +65,7 @@ on an object that will contain an ISBN.
6565
<property name="isbn">
6666
<constraint name="Isbn">
6767
<option name="type">isbn10</option>
68-
<option name="message">This value is not valid.</option>
68+
<option name="message">This value is not valid.</option>
6969
</constraint>
7070
</property>
7171
</class>

reference/constraints/NotBlank.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Options
8585
allowNull
8686
~~~~~~~~~
8787

88-
**type**: ``bool`` **default**: ``false``
88+
**type**: ``boolean`` **default**: ``false``
8989

9090
If set to ``true``, ``null`` values are considered valid and won't trigger a
9191
constraint violation.

reference/constraints/Traverse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The ``groups`` option is not available for this constraint.
146146
``traverse``
147147
~~~~~~~~~~~~
148148

149-
**type**: ``bool`` **default**: ``true``
149+
**type**: ``boolean`` **default**: ``true``
150150

151151
Instances of ``\Traversable`` are traversed by default, use this option to
152152
disable validating:

reference/forms/types/color.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Field Options
4949
html5
5050
~~~~~
5151

52-
**type**: ``bool`` **default**: ``false``
52+
**type**: ``boolean`` **default**: ``false``
5353

5454
.. versionadded:: 5.1
5555

reference/forms/types/options/help_html.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
help_html
22
~~~~~~~~~
33

4-
**type**: ``bool`` **default**: ``false``
4+
**type**: ``boolean`` **default**: ``false``
55

66
By default, the contents of the ``help`` option are escaped before rendering
77
them in the template. Set this option to ``true`` to not escape them, which is

reference/forms/types/options/label_html.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
``label_html``
22
~~~~~~~~~~~~~~
33

4-
**type**: ``bool`` **default**: ``false``
4+
**type**: ``boolean`` **default**: ``false``
55

66
.. versionadded:: 5.1
77

routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This command also creates the following configuration file:
4747
4848
# config/routes/annotations.yaml
4949
controllers:
50-
resource: '../../src/Controller/'
50+
resource: ../../src/Controller/
5151
type: annotation
5252
5353
kernel:

templates.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ Template Naming
118118

119119
Symfony recommends the following for template names:
120120

121-
* Use `snake case`_ for filenames and directories (e.g. ``blog_posts.twig``,
122-
``admin/default_theme/blog/index.twig``, etc.);
121+
* Use `snake case`_ for filenames and directories (e.g. ``blog_posts.html.twig``,
122+
``admin/default_theme/blog/index.html.twig``, etc.);
123123
* Define two extensions for filenames (e.g. ``index.html.twig`` or
124124
``blog_posts.xml.twig``) being the first extension (``html``, ``xml``, etc.)
125125
the final format that the template will generate.
@@ -164,7 +164,9 @@ in the following order:
164164
#. ``$foo->getBar()`` (object and *getter* method);
165165
#. ``$foo->isBar()`` (object and *isser* method);
166166
#. ``$foo->hasBar()`` (object and *hasser* method);
167-
#. If none of the above exists, use ``null``.
167+
#. If none of the above exists, use ``null`` (or throw a ``Twig\Error\RuntimeError``
168+
exception if the :ref:`strict_variables <config-twig-strict-variables>`
169+
option is enabled).
168170

169171
This allows to evolve your application code without having to change the
170172
template code (you can start with array variables for the application proof of

0 commit comments

Comments
 (0)