mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 02:46:29 +00:00
Update coding_standards.rst: "one (and only one)" => "exactly one"
Page: https://twig.symfony.com/doc/3.x/coding_standards.html
This commit is contained in:
@@ -10,7 +10,7 @@ Coding Standards
|
|||||||
When writing Twig templates, we recommend you to follow these official coding
|
When writing Twig templates, we recommend you to follow these official coding
|
||||||
standards:
|
standards:
|
||||||
|
|
||||||
* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``,
|
* Put exactly one space after the start of a delimiter (``{{``, ``{%``,
|
||||||
and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):
|
and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):
|
||||||
|
|
||||||
.. code-block:: twig
|
.. code-block:: twig
|
||||||
@@ -28,7 +28,7 @@ standards:
|
|||||||
{#- comment -#}
|
{#- comment -#}
|
||||||
{%- if foo -%}{%- endif -%}
|
{%- if foo -%}{%- endif -%}
|
||||||
|
|
||||||
* Put one (and only one) space before and after the following operators:
|
* Put exactly one space before and after the following operators:
|
||||||
comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
|
comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
|
||||||
operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
|
operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
|
||||||
operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
|
operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
|
||||||
@@ -40,7 +40,7 @@ standards:
|
|||||||
{{ foo ~ bar }}
|
{{ foo ~ bar }}
|
||||||
{{ true ? true : false }}
|
{{ true ? true : false }}
|
||||||
|
|
||||||
* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in
|
* Put exactly one space after the ``:`` sign in hashes and ``,`` in
|
||||||
arrays and hashes:
|
arrays and hashes:
|
||||||
|
|
||||||
.. code-block:: twig
|
.. code-block:: twig
|
||||||
|
|||||||
Reference in New Issue
Block a user