Commit Graph

4220 Commits

Author SHA1 Message Date
Fabien Potencier 4c3aaa5611 removed obsolete docs 2019-03-11 14:00:15 +01:00
Fabien Potencier dd96b16347 Merge branch '1.x' into 2.x
* 1.x:
  tweaked docs for macro
  document support for defining default argument values in the macro tag
2019-03-11 14:00:00 +01:00
Fabien Potencier 04408cda3a tweaked docs for macro 2019-03-11 13:59:54 +01:00
Fabien Potencier 1da95371d1 minor #2870 document support for defining default argument values in the macro tag (olets)
This PR was merged into the 1.x branch.

Discussion
----------

document support for defining default argument values in the macro tag

The `macro` tag documentation reads

> Macros differ from native PHP functions in a few ways:
> - Default argument values are defined by using the default filter in the macro body

and provides the example

```twig
{% macro input(name, value, type, size) %}
    <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
{% endmacro %}
```

The implication is that native PHP function-like default argument value definition is not supported.

v1.12 added support for

```twig
{% macro input1(name, value, type = 'text', size = 20) %}
    <input type="{{ type }}" name="{{ name }}" value="{{ value|e }}" size="{{ size }}" />
{% endmacro %}
```

This updates the documentation to cover both ways of defining default argument values.

Commits
-------

40c7553a document support for defining default argument values in the macro tag
2019-03-11 13:55:14 +01:00
Fabien Potencier 0ad866d513 Merge branch '1.x' into 2.x
* 1.x:
  do not check sandbox for __toString if method does not exist on object
  tweaked sandbox generated code
  fixed indentation of the compiled template
2019-03-11 12:07:26 +01:00
Fabien Potencier b1894d3df2 do not check sandbox for __toString if method does not exist on object 2019-03-11 12:03:25 +01:00
Fabien Potencier c36cf0db30 minor #2877 Tweak sandbox generated code (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Tweak sandbox generated code

Commits
-------

cbb8f6ed tweaked sandbox generated code
2019-03-11 11:49:33 +01:00
Fabien Potencier cbb8f6edc1 tweaked sandbox generated code 2019-03-11 08:53:51 +01:00
Fabien Potencier af6bdc4b12 fixed indentation of the compiled template 2019-03-11 07:48:38 +01:00
Fabien Potencier 906333bf8e minor #2875 Fix deprecation notes (nicolas-grekas)
This PR was merged into the 2.x branch.

Discussion
----------

Fix deprecation notes

`ExpressionParser` still uses `since version [...]` because the message is not only about Twig: any package providing extensions can trigger it.

Commits
-------

0f8d66be Fix deprecation notes
2019-03-10 12:28:16 +01:00
Fabien Potencier 2f1362c737 minor #2874 Remove runtime deprecation that prevent smooth update (nicolas-grekas)
This PR was merged into the 2.x branch.

Discussion
----------

Remove runtime deprecation that prevent smooth update

This deprecation is already triggered when a class that implements `InitRuntimeInterface` is loaded.
This runtime deprecation prevents creating a continuous upgrade path.

Commits
-------

8f9fe276 Remove runtime deprecation that prevent smooth update
2019-03-10 12:27:35 +01:00
Nicolas Grekas 0f8d66be38 Fix deprecation notes 2019-03-10 11:48:42 +01:00
Nicolas Grekas 8f9fe27622 Remove runtime deprecation that prevent smooth update 2019-03-10 11:40:58 +01:00
Fabien Potencier 456175d85b updated CHANGELOG 2019-03-10 10:47:33 +01:00
Fabien Potencier b631c7509f Merge branch '1.x' into 2.x
* 1.x:
  improved the performance of the sandbox
2019-03-10 10:47:02 +01:00
Fabien Potencier 7ce5261621 minor #2873 Improve the performance of the sandbox (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Improve the performance of the sandbox

Commits
-------

5c661869 improved the performance of the sandbox
2019-03-10 10:43:19 +01:00
Fabien Potencier 5c66186979 improved the performance of the sandbox 2019-03-10 10:34:31 +01:00
Fabien Potencier f3941f0662 fixed some deprecation messages 2019-03-10 10:19:10 +01:00
Fabien Potencier 432f295baa added a deprecation notice when using the spaceless tag 2019-03-10 09:05:07 +01:00
Fabien Potencier a65a807afa Merge branch '1.x' into 2.x
* 1.x:
  added a note about the performance of the spaceless filter
2019-03-10 09:00:42 +01:00
Fabien Potencier 68bbf5eb85 added a note about the performance of the spaceless filter 2019-03-10 08:59:57 +01:00
Henry Bley-Vroman 40c7553a69 document support for defining default argument values in the macro tag 2019-03-08 09:01:54 -05:00
Fabien Potencier fbb79d7752 removed dead code 2019-03-07 14:29:23 +01:00
Fabien Potencier 64f7c02431 deprecated the spaceless tag 2019-03-07 11:02:32 +01:00
Fabien Potencier 65ea4c5296 Merge branch '1.x' into 2.x
* 1.x:
  Revert "re-implemented the spaceless tag to reuse the filter tag logic"
  fixed CS
  re-implemented the spaceless tag to reuse the filter tag logic
  added a spaceless filter
  removed unneeded usage of spaceless in tests
2019-03-07 10:59:18 +01:00
Fabien Potencier 83efde6a4d Revert "re-implemented the spaceless tag to reuse the filter tag logic"
This reverts commit 743767bce8.
2019-03-07 10:58:47 +01:00
Fabien Potencier 9956811bbc feature #2872 Add spaceless filter (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2872).

Discussion
----------

Add spaceless filter

Commits
-------

a22a5c4b fixed CS
743767bc re-implemented the spaceless tag to reuse the filter tag logic
b823898e added a spaceless filter
1ba79416 removed unneeded usage of spaceless in tests
2019-03-07 10:24:21 +01:00
Fabien Potencier a22a5c4bd1 fixed CS 2019-03-07 10:20:57 +01:00
Fabien Potencier 743767bce8 re-implemented the spaceless tag to reuse the filter tag logic 2019-03-07 10:18:51 +01:00
Fabien Potencier b823898ee1 added a spaceless filter 2019-03-07 10:18:51 +01:00
Fabien Potencier 1ba7941656 removed unneeded usage of spaceless in tests 2019-03-07 08:03:42 +01:00
Fabien Potencier 29a2e18e14 Merge branch '1.x' into 2.x
* 1.x:
  fixed some issues
2019-03-06 22:09:35 +01:00
Fabien Potencier 5d79776175 bug #2871 Fix some issues (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Fix some issues

Commits
-------

c58fa840 fixed some issues
2019-03-06 22:09:17 +01:00
Fabien Potencier c58fa84054 fixed some issues 2019-03-06 22:08:00 +01:00
Fabien Potencier 8254d07064 removed @internal tag on Twig\Template as the whole class is marked as internal 2019-03-06 18:46:56 +01:00
Fabien Potencier 6ead78b202 Merge branch '1.x' into 2.x
* 1.x:
  removed @internal tag on Twig\Template as the whole class is marked as internal
2019-03-06 18:44:06 +01:00
Fabien Potencier 586d5cb411 removed @internal tag on Twig\Template as the whole class is marked as internal 2019-03-06 18:43:55 +01:00
Fabien Potencier 1705b7a233 Merge branch '1.x' into 2.x
* 1.x:
  removed some unneded phpdocs
2019-03-06 18:22:53 +01:00
Fabien Potencier 19fd71eadd removed some unneded phpdocs 2019-03-06 18:22:06 +01:00
Fabien Potencier fa8e07f754 fixed more un-namespaced classes 2019-03-06 18:19:14 +01:00
Fabien Potencier 2717a4769b fixed more un-namespaced classes 2019-03-06 18:17:28 +01:00
Fabien Potencier 71e8e981c4 Merge branch '1.x' into 2.x
* 1.x:
  fixed more un-namespaced classes
2019-03-06 18:10:47 +01:00
Fabien Potencier 9b8c3a2344 fixed more un-namespaced classes 2019-03-06 18:10:39 +01:00
Fabien Potencier 786eb012e0 Merge branch '1.x' into 2.x
* 1.x:
  fixed phpdocs
2019-03-06 15:58:01 +01:00
Fabien Potencier f75d9891b2 fixed phpdocs 2019-03-06 15:57:47 +01:00
Fabien Potencier 47b5238c67 Merge branch '1.x' into 2.x
* 1.x:
  moved some more PSR0 class names to namespaced ones
2019-03-06 14:02:19 +01:00
Fabien Potencier 690f53f98c minor #2869 Move some more PSR0 class names to namespaced ones (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Move some more PSR0 class names to namespaced ones

Commits
-------

4eb0c9da moved some more PSR0 class names to namespaced ones
2019-03-06 14:00:13 +01:00
Fabien Potencier 4eb0c9da8e moved some more PSR0 class names to namespaced ones 2019-03-06 13:58:28 +01:00
Fabien Potencier c5a9406e68 fixed typo 2019-03-06 13:28:15 +01:00
Fabien Potencier 1958e6daf4 Merge branch '1.x' into 2.x
* 1.x:
  fixed wrong usage of Error() constructor
2019-03-06 13:23:02 +01:00