Browse code

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

Fabien Potencier authored on 28/12/2019 07:09:27
Showing 11 changed files
... ...
@@ -14,7 +14,6 @@
14 14
         },
15 15
         {
16 16
             "name": "Twig Team",
17
-            "homepage": "https://twig.symfony.com/contributors",
18 17
             "role": "Contributors"
19 18
         },
20 19
         {
... ...
@@ -394,7 +394,7 @@ The escaping rules are implemented as follows:
394 394
         {% set text = "Twig<br />" %}
395 395
         {{ text }} {# will be escaped #}
396 396
 
397
-* Expressions which the result is always a literal or a variable marked safe
397
+* Expressions which the result is a literal or a variable marked safe
398 398
   are never automatically escaped:
399 399
 
400 400
   .. code-block:: twig
... ...
@@ -402,14 +402,12 @@ The escaping rules are implemented as follows:
402 402
         {{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #}
403 403
 
404 404
         {% set text = "Twig<br />" %}
405
-        {{ foo ? text : "<br />Twig" }} {# will be escaped #}
405
+        {{ true ? text : "<br />Twig" }} {# will be escaped #}
406
+        {{ false ? text : "<br />Twig" }} {# won't be escaped #}
406 407
 
407 408
         {% set text = "Twig<br />" %}
408 409
         {{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #}
409 410
 
410
-        {% set text = "Twig<br />" %}
411
-        {{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #}
412
-
413 411
 * Objects with a ``__toString`` method are converted to strings and
414 412
   escaped. You can mark some classes and/or interfaces as being safe for some
415 413
   strategies via ``EscaperExtension::addSafeClass()``:
... ...
@@ -2,7 +2,7 @@
2 2
 ===========
3 3
 
4 4
 ``same as`` checks if a variable is the same as another variable.
5
-This is the equivalent to ``===`` in PHP:
5
+This is equivalent to ``===`` in PHP:
6 6
 
7 7
 .. code-block:: twig
8 8
 
... ...
@@ -19,7 +19,7 @@
19 19
         "twig/twig": "^2.4|^3.0"
20 20
     },
21 21
     "require-dev": {
22
-        "symfony/phpunit-bridge": "^4.4@dev"
22
+        "symfony/phpunit-bridge": "^4.4|^5.0"
23 23
     },
24 24
     "autoload": {
25 25
         "psr-4" : {
... ...
@@ -15,11 +15,11 @@
15 15
     ],
16 16
     "require": {
17 17
         "php": "^7.1.3",
18
-        "symfony/mime": "^4.3",
18
+        "symfony/mime": "^4.3|^5.0",
19 19
         "twig/twig": "^2.4|^3.0"
20 20
     },
21 21
     "require-dev": {
22
-        "symfony/phpunit-bridge": "^4.4@dev"
22
+        "symfony/phpunit-bridge": "^4.4|^5.0"
23 23
     },
24 24
     "autoload": {
25 25
         "psr-4" : {
... ...
@@ -19,7 +19,7 @@
19 19
         "twig/twig": "^2.4|^3.0"
20 20
     },
21 21
     "require-dev": {
22
-        "symfony/phpunit-bridge": "^4.4@dev"
22
+        "symfony/phpunit-bridge": "^4.4|^5.0"
23 23
     },
24 24
     "autoload": {
25 25
         "psr-4" : {
... ...
@@ -19,7 +19,7 @@
19 19
         "symfony/intl": "^4.3|^5.0"
20 20
     },
21 21
     "require-dev": {
22
-        "symfony/phpunit-bridge": "^4.4@dev"
22
+        "symfony/phpunit-bridge": "^4.4|^5.0"
23 23
     },
24 24
     "autoload": {
25 25
         "psr-4" : {
... ...
@@ -18,7 +18,7 @@
18 18
         "twig/twig": "^2.4|^3.0"
19 19
     },
20 20
     "require-dev": {
21
-        "symfony/phpunit-bridge": "^4.4@dev",
21
+        "symfony/phpunit-bridge": "^4.4|^5.0",
22 22
         "erusev/parsedown": "^1.7",
23 23
         "league/commonmark": "^1.0",
24 24
         "league/html-to-markdown": "^4.8",
... ...
@@ -15,11 +15,11 @@
15 15
     ],
16 16
     "require": {
17 17
         "php": "^7.2.9",
18
-        "symfony/string": "^5.0@dev",
18
+        "symfony/string": "^5.0",
19 19
         "twig/twig": "^2.4|^3.0"
20 20
     },
21 21
     "require-dev": {
22
-        "symfony/phpunit-bridge": "^4.4@dev"
22
+        "symfony/phpunit-bridge": "^4.4|^5.0"
23 23
     },
24 24
     "autoload": {
25 25
         "psr-4" : {
... ...
@@ -20,11 +20,11 @@
20 20
         "twig/twig": "^2.4|^3.0"
21 21
     },
22 22
     "require-dev": {
23
-        "twig/cssinliner-extra": "^2.12|^3.0@dev",
24
-        "twig/html-extra": "^2.12@dev|^3.0@dev",
25
-        "twig/inky-extra": "^2.12@dev|^3.0@dev",
26
-        "twig/intl-extra": "^2.12@dev|^3.0@dev",
27
-        "twig/markdown-extra": "^2.12@dev|^3.0@dev"
23
+        "twig/cssinliner-extra": "^2.12|^3.0",
24
+        "twig/html-extra": "^2.12|^3.0",
25
+        "twig/inky-extra": "^2.12|^3.0",
26
+        "twig/intl-extra": "^2.12|^3.0",
27
+        "twig/markdown-extra": "^2.12|^3.0"
28 28
     },
29 29
     "autoload": {
30 30
         "psr-4" : {
... ...
@@ -42,7 +42,7 @@ final class Extensions
42 42
             'class' => IntlExtension::class,
43 43
             'class_name' => 'IntlExtension',
44 44
             'package' => 'twig/intl-extra',
45
-            'filters' => ['country_name', 'currency_name', 'currency_symbol', 'language_name',
45
+            'filters' => ['country_name', 'currency_name', 'currency_symbol', 'language_name', 'locale_name', 'timezone_name',
46 46
                 'format_currency', 'format_number', 'format_decimal_number', 'format_currency_number',
47 47
                 'format_percent_number', 'format_scientific_number', 'format_spellout_number', 'format_ordinal_number',
48 48
                 'format_duration_number', 'format_date', 'format_datetime', 'format_time',