Merge branch '2.x' into 3.x

* 2.x:
  support Sf5
  Fix constraints
  Update doc with new escaping behavior
  Remove obsolete page
  language typo
  Add missing suggestions in Twig Extra Bundle
This commit is contained in:
Fabien Potencier
2019-12-28 08:09:27 +01:00
11 changed files with 18 additions and 21 deletions
-1
View File
@@ -14,7 +14,6 @@
},
{
"name": "Twig Team",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
},
{
+3 -5
View File
@@ -394,7 +394,7 @@ The escaping rules are implemented as follows:
{% set text = "Twig<br />" %}
{{ text }} {# will be escaped #}
* Expressions which the result is always a literal or a variable marked safe
* Expressions which the result is a literal or a variable marked safe
are never automatically escaped:
.. code-block:: twig
@@ -402,14 +402,12 @@ The escaping rules are implemented as follows:
{{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #}
{% set text = "Twig<br />" %}
{{ foo ? text : "<br />Twig" }} {# will be escaped #}
{{ true ? text : "<br />Twig" }} {# will be escaped #}
{{ false ? text : "<br />Twig" }} {# won't be escaped #}
{% set text = "Twig<br />" %}
{{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #}
{% set text = "Twig<br />" %}
{{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #}
* Objects with a ``__toString`` method are converted to strings and
escaped. You can mark some classes and/or interfaces as being safe for some
strategies via ``EscaperExtension::addSafeClass()``:
+1 -1
View File
@@ -2,7 +2,7 @@
===========
``same as`` checks if a variable is the same as another variable.
This is the equivalent to ``===`` in PHP:
This is equivalent to ``===`` in PHP:
.. code-block:: twig
+1 -1
View File
@@ -19,7 +19,7 @@
"twig/twig": "^2.4|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4@dev"
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"autoload": {
"psr-4" : {
+2 -2
View File
@@ -15,11 +15,11 @@
],
"require": {
"php": "^7.1.3",
"symfony/mime": "^4.3",
"symfony/mime": "^4.3|^5.0",
"twig/twig": "^2.4|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4@dev"
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"autoload": {
"psr-4" : {
+1 -1
View File
@@ -19,7 +19,7 @@
"twig/twig": "^2.4|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4@dev"
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"autoload": {
"psr-4" : {
+1 -1
View File
@@ -19,7 +19,7 @@
"symfony/intl": "^4.3|^5.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4@dev"
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"autoload": {
"psr-4" : {
+1 -1
View File
@@ -18,7 +18,7 @@
"twig/twig": "^2.4|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4@dev",
"symfony/phpunit-bridge": "^4.4|^5.0",
"erusev/parsedown": "^1.7",
"league/commonmark": "^1.0",
"league/html-to-markdown": "^4.8",
+2 -2
View File
@@ -15,11 +15,11 @@
],
"require": {
"php": "^7.2.9",
"symfony/string": "^5.0@dev",
"symfony/string": "^5.0",
"twig/twig": "^2.4|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4@dev"
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"autoload": {
"psr-4" : {
+5 -5
View File
@@ -20,11 +20,11 @@
"twig/twig": "^2.4|^3.0"
},
"require-dev": {
"twig/cssinliner-extra": "^2.12|^3.0@dev",
"twig/html-extra": "^2.12@dev|^3.0@dev",
"twig/inky-extra": "^2.12@dev|^3.0@dev",
"twig/intl-extra": "^2.12@dev|^3.0@dev",
"twig/markdown-extra": "^2.12@dev|^3.0@dev"
"twig/cssinliner-extra": "^2.12|^3.0",
"twig/html-extra": "^2.12|^3.0",
"twig/inky-extra": "^2.12|^3.0",
"twig/intl-extra": "^2.12|^3.0",
"twig/markdown-extra": "^2.12|^3.0"
},
"autoload": {
"psr-4" : {
+1 -1
View File
@@ -42,7 +42,7 @@ final class Extensions
'class' => IntlExtension::class,
'class_name' => 'IntlExtension',
'package' => 'twig/intl-extra',
'filters' => ['country_name', 'currency_name', 'currency_symbol', 'language_name',
'filters' => ['country_name', 'currency_name', 'currency_symbol', 'language_name', 'locale_name', 'timezone_name',
'format_currency', 'format_number', 'format_decimal_number', 'format_currency_number',
'format_percent_number', 'format_scientific_number', 'format_spellout_number', 'format_ordinal_number',
'format_duration_number', 'format_date', 'format_datetime', 'format_time',