Commit Graph

4675 Commits

Author SHA1 Message Date
Fabien Potencier 3cd635bf91 bumped version to 2.11.2-DEV 2019-06-04 13:33:20 +02:00
Fabien Potencier 0418e17113 prepared the 2.11.1 release v2.11.1 2019-06-04 13:32:47 +02:00
Fabien Potencier 26a0e265bf minor #3050 Add a doc note (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Add a doc note

closes #3045

Commits
-------

ee7be2e1 added a doc note
2019-06-04 10:53:43 +02:00
Fabien Potencier ee7be2e187 added a doc note 2019-06-04 10:53:04 +02:00
Fabien Potencier eb9a3e245e updated CHANGELOG 2019-06-03 18:44:27 +02:00
Fabien Potencier 43bc74a7d0 Merge branch '1.x' into 2.x
* 1.x:
  added support for "Twig\Markup" instances in the "in" test (again)
2019-06-03 18:38:09 +02:00
Fabien Potencier ec55f5716e bug #3049 Add support for "Twig\Markup" instances in the "in" test (again) (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add support for "Twig\Markup" instances in the "in" test (again)

Commits
-------

2218cfe2 added support for "Twig\Markup" instances in the "in" test (again)
2019-06-03 18:37:40 +02:00
Fabien Potencier 2218cfe26b added support for "Twig\Markup" instances in the "in" test (again) 2019-06-03 18:20:29 +02:00
Fabien Potencier 5d70ff2ac2 Merge branch '1.x' into 2.x
* 1.x:
  Update the documentation for newly added features
2019-06-03 15:30:58 +02:00
Fabien Potencier 25cc3e418a bug #3046 Fixed: Endless loop if more than one parent without the macro exists (nea)
This PR was squashed before being merged into the 2.x branch (closes #3046).

Discussion
----------

Fixed: Endless loop if more than one parent without the macro exists

Hi @fabpot

I made a quick fix for the parent macro method call fix you did for me in #3042. Your code works in case the direct parent has the macro. But if there is a longer hierarchy and the looked for macro is in a parent template +1 it runs into an endless loop because the `->getParent()` method is always called on `$template` but never the newer `$parent`.

Best

Commits
-------

44970833 Fixed: Endless loop if more than one parent without the macro exists
2019-06-03 15:30:29 +02:00
Savas Ziplies 4497083325 Fixed: Endless loop if more than one parent without the macro exists 2019-06-03 15:30:23 +02:00
Fabien Potencier b7b5f1bac9 bug #3047 Update the documentation for newly added features (nexsja)
This PR was submitted for the 2.x branch but it was squashed and merged into the 1.x branch instead (closes #3047).

Discussion
----------

Update the documentation for newly added features

The `map`, `filter` and `reduce` functions were added in Twig 1.41 and 2.10, but the documentation for `map` and `reduce` did not contain the information in which 2.x version these functions were added.
This minor PR fixes this.

Commits
-------

bf518d2c Update the documentation for newly added features
2019-06-03 15:28:34 +02:00
Alex bf518d2cca Update the documentation for newly added features 2019-06-03 15:28:27 +02:00
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