Commit Graph

7855 Commits

Author SHA1 Message Date
Fabien Potencier ec85153849 minor #4761 Fix tests (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Fix tests

Commits
-------

2fba06cba9 Fix tests
2026-02-07 09:21:12 +01:00
Fabien Potencier 2fba06cba9 Fix tests 2026-02-07 09:18:21 +01:00
Fabien Potencier 1787147485 minor #4763 Fix CS (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Fix CS

Commits
-------

cdce18d02a Fix CS
2026-02-07 09:17:49 +01:00
Fabien Potencier cdce18d02a Fix CS 2026-02-07 09:16:06 +01:00
Fabien Potencier df07638b63 Merge branch '3.x' into 4.x
* 3.x:
  Use stable versions of tools
2026-02-07 09:13:11 +01:00
Fabien Potencier 44093544e6 Use stable versions of tools 2026-02-07 09:12:49 +01:00
Fabien Potencier 0facb551b0 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2026-02-07 09:12:05 +01:00
Fabien Potencier 2c2d2fd435 minor #4762 Fix CS (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix CS

Commits
-------

861215c507 Fix CS
2026-02-07 09:10:10 +01:00
Fabien Potencier 861215c507 Fix CS 2026-02-07 09:07:38 +01:00
Fabien Potencier 99d77b1141 Remove versionadded in docs 2026-02-06 22:46:24 +01:00
Fabien Potencier 0222460a72 Merge branch '3.x' into 4.x
* 3.x:
  Bump version
  Add a not about the return value of destructuring
  Fix null-safe operator test
  Bump version
  Prepare the  release
  Update CHANGELOG
  Add support for object and mapping destructuring
  Rename classes
  Assignment operator array destructuring
  Fix doc notes
  Fix doc notes
  Add the = assignment operator
  Fix grammar and spelling mistakes in documentation
2026-02-06 22:45:48 +01:00
Fabien Potencier eb516c9740 minor #4755 Add a not about the return value of destructuring (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add a not about the return value of destructuring

Commits
-------

c38868cdd0 Add a not about the return value of destructuring
2026-02-06 22:15:10 +01:00
Fabien Potencier 09e6bb5a91 Bump version 2026-02-06 22:12:49 +01:00
Fabien Potencier c38868cdd0 Add a not about the return value of destructuring 2026-02-04 22:36:00 +01:00
Fabien Potencier 87848155a5 minor #4749 Fix null-safe operator test (HypeMC)
This PR was merged into the 3.x branch.

Discussion
----------

Fix null-safe operator test

Noticed this while working on #4748.

Without `strict_variables`, the tests always pass, even when the null-safe operator is not used.

Commits
-------

a16ac6bd35 Fix null-safe operator test
2026-01-27 11:37:59 +01:00
HypeMC a16ac6bd35 Fix null-safe operator test 2026-01-25 04:57:19 +01:00
Fabien Potencier 111b867703 Bump version 2026-01-23 22:27:43 +01:00
Fabien Potencier a64dc5d2cc Prepare the release v3.23.0 2026-01-23 22:00:41 +01:00
Fabien Potencier b0c42a9739 Update CHANGELOG 2026-01-23 22:00:23 +01:00
Fabien Potencier b609ae9d0d feature #4744 Add support for object and mapping destructuring (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for object and mapping destructuring

Refs https://github.com/twigphp/Twig/issues/3399

Commits
-------

8a0f8acbdf Add support for object and mapping destructuring
2026-01-23 12:57:17 +01:00
Fabien Potencier 8a0f8acbdf Add support for object and mapping destructuring 2026-01-21 13:21:14 +01:00
Fabien Potencier 76c404ec67 Rename classes 2026-01-21 13:14:16 +01:00
Fabien Potencier d784400fb2 feature #4742 Assignment operator array destructuring (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Assignment operator array destructuring

Follow-up to the introduction of the new = operator, array destructuring.
Refs #3399

Commits
-------

bb99af3b39 Assignment operator array destructuring
2026-01-21 08:46:31 +01:00
Fabien Potencier bb99af3b39 Assignment operator array destructuring 2026-01-21 08:46:28 +01:00
Fabien Potencier dfeb162464 Fix doc notes 2026-01-21 08:36:53 +01:00
Fabien Potencier 85ccfb10c2 Fix doc notes 2026-01-21 08:34:47 +01:00
Fabien Potencier be1797da0c feature #4735 Add the = assignment operator (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add the = assignment operator

Commits
-------

bfbbef05f2 Add the = assignment operator
2026-01-19 21:23:20 +01:00
Fabien Potencier bfbbef05f2 Add the = assignment operator 2026-01-19 16:39:57 +01:00
Fabien Potencier 820eed38a1 minor #4741 Fix grammar and spelling mistakes in documentation (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix grammar and spelling mistakes in documentation

Commits
-------

77cd2fd9f7 Fix grammar and spelling mistakes in documentation
2026-01-17 22:38:28 +01:00
Fabien Potencier 77cd2fd9f7 Fix grammar and spelling mistakes in documentation 2026-01-17 22:34:06 +01:00
Fabien Potencier e968cf6591 Merge branch '3.x' into 4.x
* 3.x:
  Tweak null-safe operator implementation
  Add null-safe operator
  Update u.rst to clarify truncate method's third argument behavior
2026-01-17 15:17:13 +01:00
Fabien Potencier c02aa11d0c minor #4740 Tweak null-safe operator implementation (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Tweak null-safe operator implementation

Follow-up for #4717

Commits
-------

6904954165 Tweak null-safe operator implementation
2026-01-17 15:14:24 +01:00
Fabien Potencier 6904954165 Tweak null-safe operator implementation 2026-01-17 15:11:37 +01:00
Fabien Potencier b1b2a0923f feature #4717 Add null-safe operator (felds)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Add null-safe operator

Adds native support for Twig’s null-safe `?.` operator so templates can traverse objects and arrays without defensive plumbing: `{{ user?.address?.city }}` now renders the value when present and stays silent when any hop is `null`.

`?.` reuses the existing `GetAttrExpression` operator, so it should have otherwise the same precedence and behavior as `.`.

Usage cases can be found in the tests:
https://github.com/twigphp/Twig/blob/7d98d45f58df040f41a81f7f8d4cce6c42be781e/tests/ExpressionParserTest.php#L304-L343

Tests cover both the rendered output and the generated PHP.

Let me know if any tests are missing or if the implementation should be done any other way.

Commits
-------

263c04fd1f Add null-safe operator
2026-01-17 14:57:55 +01:00
Felds Liscia 263c04fd1f Add null-safe operator 2026-01-17 14:57:47 +01:00
Fabien Potencier 2bddfddb7d minor #4737 Update u.rst to clarify truncate method's third argument behavior (Always-Victorious)
This PR was merged into the 3.x branch.

Discussion
----------

Update u.rst to clarify truncate method's third argument behavior

Current wording "to preserve whole words" suggests setting the argument to ``true`` preserves words. However, the parameter is ``$cut`` (defaults to ``true`` for cutting at exact length), and ``false`` is required to preserve whole words.

Commits
-------

28c2606be7 Update u.rst to clarify truncate method's third argument behavior
2026-01-17 10:27:09 +01:00
Fabien Potencier 46f0152bcd Remove versionadded from docs 2026-01-17 10:25:10 +01:00
Fabien Potencier 280960d9e1 Merge branch '3.x' into 4.x
* 3.x:
  Fix documentation for getOperators()
  bump version
  Enhance enum.rst with dynamic case example
  Add === and !== operators
  Update extends.rst
  Fix spread operator behavior
2026-01-17 10:24:43 +01:00
Fabien Potencier bd4b47e38c minor #4739 Fix documentation for getOperators() (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix documentation for getOperators()

Closes #4710

Commits
-------

ae51f93f70 Fix documentation for getOperators()
2026-01-17 10:21:12 +01:00
Fabien Potencier ae51f93f70 Fix documentation for getOperators() 2026-01-17 10:19:56 +01:00
Fabien Potencier 141e984c3e minor #4738 bump version (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

bump version

#4736 added new operators thus require the minor version to be increased

Commits
-------

55cb67f87d bump version
2026-01-16 13:48:36 +01:00
Christian Flothmann 55cb67f87d bump version 2026-01-16 11:26:26 +01:00
Always-Victorious 28c2606be7 Update u.rst to clarify truncate method's third argument behavior
Current wording "to preserve whole words" suggests setting the argument to ``true`` preserves words. However, the parameter is ``$cut`` (defaults to ``true`` for cutting at exact length), and ``false`` is required to preserve whole words.
2026-01-15 15:43:42 +01:00
Fabien Potencier 94abd1c39b feature #4736 Add === and !== operators (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add === and !== operators

Commits
-------

94c8bdd6a6 Add === and !== operators
2026-01-14 22:27:11 +01:00
Fabien Potencier 3ef425879d minor #4726 Enhance enum.rst with dynamic case example (Kocal)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Enhance enum.rst with dynamic case example

Added example for dynamic enum case display.

Commits
-------

bcc5ffc301 Enhance enum.rst with dynamic case example
2026-01-14 22:26:14 +01:00
Hugo Alliaume bcc5ffc301 Enhance enum.rst with dynamic case example 2026-01-14 22:26:11 +01:00
Fabien Potencier 94c8bdd6a6 Add === and !== operators 2026-01-14 09:58:48 +01:00
Fabien Potencier 0b1ef6cda0 minor #4734 Update extends.rst (MAHADEV-J)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Update extends.rst

Semantically correct HTML elements instead of `<div>`itis

Commits
-------

5b63d90bfb Update extends.rst
2026-01-14 08:47:34 +01:00
MAHADEV-J 5b63d90bfb Update extends.rst 2026-01-14 08:47:31 +01:00
Fabien Potencier 2d741f9a16 bug #4731 Fix spread operator behavior (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix spread operator behavior

Closes #4637

Commits
-------

2376bbaf3e Fix spread operator behavior
2026-01-13 10:14:41 +01:00