Commit Graph

4662 Commits

Author SHA1 Message Date
Fabien Potencier 0840c7902b updated CHANGELOG 2019-06-03 12:43:00 +02:00
Fabien Potencier 3fde1536d3 Merge branch '1.x' into 2.x
* 1.x:
  allowed string operators as variables names in assignments
2019-06-03 12:15:17 +02:00
Fabien Potencier 51f33f75f9 feature #3044 Allow string operators as variables names in assignments (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Allow string operators as variables names in assignments

closes #3041

Commits
-------

5835c234 allowed string operators as variables names in assignments
2019-06-03 12:13:56 +02:00
Fabien Potencier 5835c2344f allowed string operators as variables names in assignments 2019-06-03 11:58:56 +02:00
Fabien Potencier 96b25fdccf added more tests 2019-06-03 11:22:45 +02:00
Fabien Potencier cd8cfd83e7 bug #3043 Fix macro inheritance (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Fix macro inheritance

closes #3042

Commits
-------

21ecf010 fixed macro inheritance
2019-06-03 11:19:26 +02:00
Fabien Potencier 21ecf010a3 fixed macro inheritance 2019-06-03 11:11:17 +02:00
Fabien Potencier 23fb803e5b Merge branch '1.x' into 2.x
* 1.x:
  moved a test
2019-06-03 10:47:45 +02:00
Fabien Potencier a42e02dd90 moved a test 2019-06-03 10:47:32 +02:00
Fabien Potencier 537c05039e Merge branch '1.x' into 2.x
* 1.x:
  added some tests
  bumped version to 1.42.1-DEV
  prepared the 1.42.0 release
  Use v5.0 of the phpunit bridge
2019-06-03 10:38:34 +02:00
Fabien Potencier 1f0f92b30e added some tests 2019-06-03 10:37:26 +02:00
Fabien Potencier 0a5d8cf037 bumped version to 2.11.1-DEV 2019-05-31 08:22:20 +02:00
Fabien Potencier c344879ae5 prepared the 2.11.0 release v2.11.0 2019-05-31 08:21:42 +02:00
Fabien Potencier 0a63973675 bumped version to 1.42.1-DEV 2019-05-31 08:20:41 +02:00
Fabien Potencier 2983fcf2e2 prepared the 1.42.0 release v1.42.0 2019-05-31 08:20:05 +02:00
Fabien Potencier bb20937d8c minor #3035 Use v5.0 of the phpunit bridge (nicolas-grekas)
This PR was merged into the 1.x branch.

Discussion
----------

Use v5.0 of the phpunit bridge

Not critical but still better IMHO :)

Commits
-------

2e6f74af Use v5.0 of the phpunit bridge
2019-05-28 17:27:45 +02:00
Nicolas Grekas 2e6f74af57 Use v5.0 of the phpunit bridge 2019-05-28 16:57:04 +02:00
Fabien Potencier 988b34b744 minor #3031 Add missing template name and line no to some deprecation messages (yceruto)
This PR was merged into the 2.x branch.

Discussion
----------

Add missing template name and line no to some deprecation messages

before:
![twig-before](https://user-images.githubusercontent.com/2028198/58422946-e1346080-8061-11e9-80e1-b75418fe03e9.png)

after:
![twig-after](https://user-images.githubusercontent.com/2028198/58422955-e85b6e80-8061-11e9-9c20-2bbf0ccb5009.png)

Commits
-------

8cd300f5 Add missing template name and line no to some deprecation messages
2019-05-28 15:00:43 +02:00
Yonel Ceruto 8cd300f5a5 Add missing template name and line no to some deprecation messages 2019-05-28 08:49:56 -04:00
Fabien Potencier 0ee2361739 Merge branch '1.x' into 2.x
* 1.x:
  Fix typo in filter doc
2019-05-28 12:28:06 +02:00
Fabien Potencier a79457eb9a minor #3032 Fix typo in filter doc (yceruto)
This PR was merged into the 1.x branch.

Discussion
----------

Fix typo in filter doc

Commits
-------

94064136 Fix typo in filter doc
2019-05-28 12:27:49 +02:00
Yonel Ceruto 940641364b Fix typo in filter doc 2019-05-27 09:59:11 -04:00
Fabien Potencier b2f449f14e feature #3025 Add the possibility to register classes/interface as being safe (fabpot)
This PR was squashed before being merged into the 2.x branch (closes #3025).

Discussion
----------

Add the possibility to register classes/interface as being safe

closes #2548

To avoid a too big performance impact on the escaper, we aggressively cache the safe classes, which means that changing the. configuration at runtime is not possible (and having different ones on 2 Twig instances is not possible either, this is really *globally* configured).

Commits
-------

fe6503fe -
b18733bc added the possibility to register classes/interfaces as being safe for the escaper
2019-05-25 12:23:33 +02:00
Fabien Potencier 24a8e38c65 Merge branch '1.x' into 2.x
* 1.x:
  tweaked docs
  Add information for when `filter` filter was added in 2.x branch
  tweaked docs
  doc(filter): add example of `filter` without `for` use
2019-05-22 15:59:33 +02:00
Fabien Potencier cca7007abd tweaked docs 2019-05-22 15:59:27 +02:00
Fabien Potencier 6b91b3b123 minor #3027 Add information for when filter filter was added in 2.x branch (YetiCGN)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #3027).

Discussion
----------

Add information for when `filter` filter was added in 2.x branch

The current "versionadded" info can be confusing to developers, if they assume 2.9 > 1.41 and don't know that 1.x and 2.x branches are still developed simultaneously.

Commits
-------

a05da6db Add information for when `filter` filter was added in 2.x branch
2019-05-22 15:58:49 +02:00
Jörn Wagner a05da6dbbe Add information for when filter filter was added in 2.x branch
The current "versionadded" info can be confusing to developers, if they assume 2.9 > 1.41 and don't know that 1.x and 2.x branches are still developed simultaneously.
2019-05-22 15:58:42 +02:00
Fabien Potencier fe6503fe02 - 2019-05-21 16:09:37 +02:00
Fabien Potencier b18733bce0 added the possibility to register classes/interfaces as being safe for the escaper 2019-05-21 15:41:28 +02:00
Fabien Potencier f2367b0f5f moved tests 2019-05-21 15:36:37 +02:00
Fabien Potencier ce3c8ffe37 feature #3026 Deprecate CoreExtension::setEscaper() and CoreExtension::getEscaper() in favor of the same methods on EscaperExtension (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Deprecate CoreExtension::setEscaper() and CoreExtension::getEscaper() in favor of the same methods on EscaperExtension

This is some preliminary work to ease #3025. Everything related to escaping is now part of the `EscaperExtension` instead of `CoreExtension`. This PR is submitted on 2.x because both extensions are always available in 2.x (which is not the case on 1.x).

Commits
-------

59d1d5d4 deprecated CoreExtension::setEscaper() and CoreExtension::getEscaper() in favor of the same methods on EscaperExtension
2019-05-21 15:00:59 +02:00
Fabien Potencier 59d1d5d4b6 deprecated CoreExtension::setEscaper() and CoreExtension::getEscaper() in favor of the same methods on EscaperExtension 2019-05-21 09:01:26 +02:00
Fabien Potencier 571929f263 tweaked docs 2019-05-20 09:21:53 +02:00
Fabien Potencier 4425af25d2 minor #3024 doc(filter): add example of filter without for use (Kocal)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #3024).

Discussion
----------

doc(filter): add example of `filter` without `for` use

First, thanks for #2996! :)

This PR add an example of `filter` usage without using a `for` loop, to prevend some misinterpretation to people.

At first read, I thought `filter` was only usable with `for` loop, but nope. In fact it iterates on the result produced by `filter`.

Commits
-------

847276a6 doc(filter): add example of `filter` without `for` use
2019-05-20 09:18:53 +02:00
Hugo Alliaume 847276a6b9 doc(filter): add example of filter without for use 2019-05-20 09:18:47 +02:00
Fabien Potencier 98ea3b0e62 updated CHANGELOG 2019-05-20 08:27:22 +02:00
Fabien Potencier 291bbe5b8e feature #3019 Local macros auto-import (fabpot)
This PR was squashed before being merged into the 2.x branch (closes #3019).

Discussion
----------

Local macros auto-import

closes #1758, closes #861

This implements auto-import for macros defined in a template. To avoid BC breaks, I've decided to do the auto-import as the equivalent of `{% import _self as _self %}`, so local macros are loaded under the `_self` pseudo-variable:

```twig
{{ _self.hello("Fabien") }}

{% macro hello(name) -%}
    Hello {{ name }}
{% endmacro %}
```

~~Note that this is done via a new extension that you need to explicitly enable for now. We can remove the need for the extension, just not sure if we want it. WDYT?~~

Commits
-------

3fcbc442 Local macros auto-import
2019-05-18 15:49:37 +02:00
Fabien Potencier 3fcbc44205 Local macros auto-import 2019-05-18 15:49:29 +02:00
Fabien Potencier 5a56076659 fixed CS 2019-05-18 11:24:16 +02:00
Fabien Potencier 07f294c9a3 minor #3022 Update docs for macros (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Update docs for macros

Commits
-------

c71026be updated docs for macros
2019-05-18 11:15:50 +02:00
Fabien Potencier c71026beab updated docs for macros 2019-05-18 11:14:27 +02:00
Fabien Potencier 78e4508a7c Merge branch '1.x' into 2.x
* 1.x:
  simplified code
2019-05-18 10:57:00 +02:00
Fabien Potencier 2a8fa63690 minor #3021 Simplify code (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Simplify code

Commits
-------

3ed9fae6 simplified code
2019-05-18 10:56:15 +02:00
Fabien Potencier 3ed9fae6fa simplified code 2019-05-18 10:50:41 +02:00
Fabien Potencier 3249a7710e Merge branch '1.x' into 2.x
* 1.x:
  tweaked docs for macros
2019-05-18 10:44:15 +02:00
Fabien Potencier a0fea74c7a minor #3020 Tweak docs for macros (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Tweak docs for macros

Commits
-------

53496d53 tweaked docs for macros
2019-05-18 10:42:02 +02:00
Fabien Potencier 53496d53d8 tweaked docs for macros 2019-05-18 10:33:25 +02:00
Fabien Potencier a38ccea3d1 feature #3018 Add a better error message for unknown macros (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Add a better error message for unknown macros

Commits
-------

1153534a added a better error message for unknown macros
2019-05-18 09:08:39 +02:00
Fabien Potencier 1153534aac added a better error message for unknown macros 2019-05-18 09:01:55 +02:00
Fabien Potencier 60ab3e7134 fixed CS 2019-05-18 06:15:39 +02:00