Commit Graph

7413 Commits

Author SHA1 Message Date
Fabien Potencier 63b86e3057 Merge branch '3.x' into 4.x
* 3.x:
  Fix the null coalescing operator when the test returns null
  Fix the Elvis operator when there is some space between ? and :
  Bump version
  Prepare the 3.17.0 release
  Update CHANGELOG
2024-12-12 10:28:23 +01:00
Fabien Potencier 243f5f5d53 bug #4500 Fix the null coalescing operator when the test returns null (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the null coalescing operator when the test returns null

Closes #4499

Commits
-------

4c5467f56a Fix the null coalescing operator when the test returns null
2024-12-12 10:27:04 +01:00
Fabien Potencier 4c5467f56a Fix the null coalescing operator when the test returns null 2024-12-12 10:17:22 +01:00
Fabien Potencier 47f527ef84 bug #4498 Fix the Elvis operator when there is some space between ? and : (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the Elvis operator when there is some space between ? and :

Commits
-------

1af334be89 Fix the Elvis operator when there is some space between ? and :
2024-12-11 11:04:38 +01:00
Fabien Potencier 1af334be89 Fix the Elvis operator when there is some space between ? and : 2024-12-11 10:38:21 +01:00
Fabien Potencier 31f61bd781 Bump version 2024-12-10 16:20:20 +01:00
Fabien Potencier d3a64b742a Prepare the 3.17.0 release v3.17.0 2024-12-10 16:19:11 +01:00
Fabien Potencier e24078cd0e Update CHANGELOG 2024-12-10 16:18:27 +01:00
Fabien Potencier 0c47b50522 Merge branch '3.x' into 4.x
* 3.x:
  Fix ArrayAccess with objects as keys
2024-12-10 16:16:52 +01:00
Fabien Potencier d8a798c2cf bug #4496 Fix ArrayAccess with objects as keys (gharlan)
This PR was merged into the 3.x branch.

Discussion
----------

Fix ArrayAccess with objects as keys

fixes #4476
The bug was introduced in 3.15 via https://github.com/twigphp/Twig/pull/4425#discussion_r1869120001

Commits
-------

32a75b7869 Fix ArrayAccess with objects as keys
2024-12-10 15:38:55 +01:00
Gregor Harlan 32a75b7869 Fix ArrayAccess with objects as keys 2024-12-05 12:31:45 +01:00
Fabien Potencier 6e88a901a0 minor #4494 Bump Phpstan to level 4 (VincentLanglet)
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Bump Phpstan to level 4

Commits
-------

29fce6de1e Bump Phpstan to level 4
2024-12-02 20:49:27 +01:00
Vincent Langlet 29fce6de1e Bump Phpstan to level 4 2024-12-02 20:49:24 +01:00
Fabien Potencier f087bd6aed Fix composer.json order 2024-12-02 17:36:43 +01:00
Fabien Potencier b9e3ccd7a3 Merge branch '3.x' into 4.x
* 3.x:
  fix version numbers for deprecations
  Require "erusev/parsedown": "dev-master as 1.x-dev"
  Support underscores in number literals
  Remove deprecate usage of AssignNameExpression in For Node
  Update coding standards
2024-12-02 17:35:59 +01:00
Fabien Potencier 57bf519af2 minor #4492 fix version numbers for deprecations (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

fix version numbers for deprecations

#4482 was merged after the release of 3.16.0

Commits
-------

f90105d0ac fix version numbers for deprecations
2024-12-02 10:21:10 +01:00
Christian Flothmann f90105d0ac fix version numbers for deprecations 2024-12-02 10:21:03 +01:00
Fabien Potencier b917be5db5 minor #4490 add back minimum stability (xabbuh)
This PR was merged into the 4.x branch.

Discussion
----------

add back minimum stability

enforce stable releases of dev tools instead

Commits
-------

351129cffa add back minimum stability
2024-12-02 10:19:53 +01:00
Fabien Potencier e1a5aa175e minor #4493 Require "erusev/parsedown": "dev-master as 1.x-dev" (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Require "erusev/parsedown": "dev-master as 1.x-dev"

Should fix the CI until https://github.com/erusev/parsedown/pull/891 is merged.

Commits
-------

5287da57cc Require "erusev/parsedown": "dev-master as 1.x-dev"
2024-12-02 10:19:22 +01:00
Nicolas Grekas 5287da57cc Require "erusev/parsedown": "dev-master as 1.x-dev" 2024-12-02 09:57:02 +01:00
Fabien Potencier d894f92d12 feature #4487 Support underscores in number literals (smnandre)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Support underscores in number literals

```twig
{{ 1000 == 1_000 ? 'yes' : 'no' }}
# now: syntax error
# this PR: "yes"
```

> As of PHP 7.4.0, integer literals may contain underscores (_) between digits, for better readability of literals. These underscores are removed by PHP's scanner.

https://www.php.net/manual/en/language.types.integer.php

This PR replicates that behaviour, using the regexp to match the literals and then remove the "_".

I'm targeting **Twig4** but maybe 3.x would be ok?

I cannot think of a real case that
- does not trigger an error currently
- would work differently after this PR

Commits
-------

da4d96692a Support underscores in number literals
2024-12-02 09:47:00 +01:00
Simon André da4d96692a Support underscores in number literals 2024-12-02 09:46:54 +01:00
Fabien Potencier 6cc64f2357 minor #4489 Remove deprecate usage of AssignNameExpression in For Node (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove deprecate usage of AssignNameExpression in For Node

Commits
-------

616cd06914 Remove deprecate usage of AssignNameExpression in For Node
2024-12-01 14:37:18 +01:00
Christian Flothmann 351129cffa add back minimum stability
enforce stable releases of dev tools instead
2024-12-01 12:33:25 +01:00
Fabien Potencier 616cd06914 Remove deprecate usage of AssignNameExpression in For Node 2024-12-01 10:44:44 +01:00
Fabien Potencier 196c9dcf85 minor #4472 [Twig 4] Add PHPUnit as dev dependency (ruudk)
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

[Twig 4] Add PHPUnit as dev dependency

This makes it easier to run the tests locally.

I understand we didn't do this previously (Twig 3) because of `symfony/simple-phpunit`. But that is now removed in Twig 4, so maybe we can do this as well?

Commits
-------

c352a8d283 [Twig 4] Add PHPUnit as dev dependency
2024-12-01 10:29:11 +01:00
Ruud Kamphuis c352a8d283 [Twig 4] Add PHPUnit as dev dependency 2024-12-01 10:29:08 +01:00
Fabien Potencier c5ebc12cde minor #4488 Update coding standards (VincentLanglet)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Update coding standards

Commits
-------

07a4ed17d2 Update coding standards
2024-11-30 10:52:06 +01:00
Vincent Langlet 07a4ed17d2 Update coding standards 2024-11-30 10:52:04 +01:00
Fabien Potencier 80020a66a4 Fix CS 2024-11-30 10:08:56 +01:00
Fabien Potencier 82cde4edcb Fix CS 2024-11-30 09:45:07 +01:00
Fabien Potencier cf105b566a Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-11-30 09:43:08 +01:00
Fabien Potencier 14fc89ebea Fix CS 2024-11-30 09:42:13 +01:00
Fabien Potencier aaf4a50804 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
  Use [] instead of array() to represent a constant value in compiled code
  Add more coding standard rules
2024-11-30 09:36:36 +01:00
Fabien Potencier 44516133e2 Fix CS 2024-11-30 09:33:57 +01:00
Fabien Potencier f9f9653b08 minor #4466 Fix PHPStan for Twig 4.x (VincentLanglet)
This PR was merged into the 4.x branch.

Discussion
----------

Fix PHPStan for Twig 4.x

Hi `@fabpot`, to help introducing PHPStan on 4.x, I made the merge 3.x into 4.x
- Fixing the conflits
- Fixing PHPStan build

I have
- A commit with the merge https://github.com/twigphp/Twig/pull/4466/commits/6a82e16617183c793bad4cfa672cee3c3923b714

- A commit with the update needed to get PHPStan build green in 4.x https://github.com/twigphp/Twig/pull/4466/commits/cb89b7528c997dd11a1a28192eba11a9fdbe5f5f

Commits
-------

0cb1728113 PHPStan fixes
2024-11-30 09:32:22 +01:00
Fabien Potencier f0066c8682 minor #4474 Add more coding standard rules (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add more coding standard rules

Commits
-------

c96aefdf04 Add more coding standard rules
2024-11-30 09:31:25 +01:00
Fabien Potencier 101d181cc1 minor #4486 Use [] instead of array() to represent a constant value in compiled code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Use [] instead of array() to represent a constant value in compiled code

Commits
-------

49f384f107 Use [] instead of array() to represent a constant value in compiled code
2024-11-30 09:30:56 +01:00
Vincent Langlet 0cb1728113 PHPStan fixes 2024-11-29 23:15:53 +01:00
Fabien Potencier 49f384f107 Use [] instead of array() to represent a constant value in compiled code 2024-11-29 21:57:12 +01:00
Fabien Potencier c96aefdf04 Add more coding standard rules 2024-11-29 21:26:34 +01:00
Fabien Potencier 223ddb5d44 Merge branch '3.x' into 4.x
* 3.x:
  Update phpdoc for operators
2024-11-29 21:20:20 +01:00
Fabien Potencier 3eed037eed minor #4485 Update phpdoc for operators (VincentLanglet)
This PR was merged into the 3.x branch.

Discussion
----------

Update phpdoc for operators

Commits
-------

fab565ca34 Update phpdoc for operators
2024-11-29 21:19:27 +01:00
Fabien Potencier 5ad1aca4df Fix code 2024-11-29 21:18:15 +01:00
Vincent Langlet fab565ca34 Update phpdoc for operators 2024-11-29 19:30:47 +01:00
Fabien Potencier fd833197d3 Remove deprecation, update code 2024-11-29 19:28:34 +01:00
Fabien Potencier 81c7e8f86f Merge branch '3.x' into 4.x
* 3.x:
  Enforce AbstractBinary for all binary operators
  Fix CHANGELOG
  Bump version
  Prepare the 3.16.0 release
2024-11-29 19:26:31 +01:00
Fabien Potencier d1d8e3c62a feature #4482 Enforce AbstractBinary for all binary operators (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Enforce AbstractBinary for all binary operators

Commits
-------

4f8ba93600 Enforce AbstractBinary for all binary operators
2024-11-29 19:21:56 +01:00
Fabien Potencier 4f8ba93600 Enforce AbstractBinary for all binary operators 2024-11-29 16:51:09 +01:00
Fabien Potencier 4e1cbc74ef Fix CHANGELOG 2024-11-29 09:29:04 +01:00