Commit Graph

7387 Commits

Author SHA1 Message Date
Christian Flothmann 351129cffa add back minimum stability
enforce stable releases of dev tools instead
2024-12-01 12:33:25 +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 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
Fabien Potencier 5307894b0c Bump version 2024-11-29 09:28:25 +01:00
Fabien Potencier 475ad2dc97 Prepare the 3.16.0 release v3.16.0 2024-11-29 09:27:05 +01:00
Fabien Potencier af8c63d12f Merge branch '3.x' into 4.x
* 3.x:
  Simplify code even more
2024-11-28 16:08:12 +01:00
Fabien Potencier ef3dbab6b1 minor #4481 Simplify code even more (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify code even more

More simplifications

Commits
-------

2337c7f812 Simplify code even more
2024-11-28 16:07:17 +01:00
Fabien Potencier 2337c7f812 Simplify code even more 2024-11-28 14:36:54 +01:00
Fabien Potencier edef08290d Simplify code 2024-11-28 14:26:21 +01:00
Fabien Potencier 4937b66e17 Remove deprecations 2024-11-28 14:24:56 +01:00
Fabien Potencier 5a974d55e1 Fix merge 2024-11-28 14:21:52 +01:00
Fabien Potencier e69c1abe6c Merge branch '3.x' into 4.x
* 3.x:
  Simplify EscaperNodeVisitor code
  Fix having macro variables starting with an underscore
  Fix CS
  Fix EscapeNodeVisitor::isSafeFor()
  Simplify code
2024-11-28 14:21:03 +01:00
Fabien Potencier ae82e8bd0d feature #4479 Simplify EscaperNodeVisitor code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify EscaperNodeVisitor code

This PR simplifies how we escape the ternary operator, and simplifies the whole strategy.
Instead of replacing the `PrintNode`s, we instead "just" wrap the inner expressions.

For the ternary operator, the `InlinePrint` expression is useless and even weird as printing something in the middle of an expression looks very wrong. This is not done anymore and the node is deprecated.

Overall, this PR makes fewer changes to the Node tree which should make things use a bit less memory.

Commits
-------

02cec77619 Simplify EscaperNodeVisitor code
2024-11-28 12:30:00 +01:00
Fabien Potencier 02cec77619 Simplify EscaperNodeVisitor code 2024-11-28 11:53:08 +01:00
Fabien Potencier c384fb4d8c bug #4475 Fix having macro variables starting with an underscore (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix having macro variables starting with an underscore

Closes #4452

Commits
-------

bdb0f3c042 Fix having macro variables starting with an underscore
2024-11-26 21:41:33 +01:00
Fabien Potencier bdb0f3c042 Fix having macro variables starting with an underscore 2024-11-26 16:59:45 +01:00
Fabien Potencier 0176de0fa9 Fix CS 2024-11-26 16:57:59 +01:00
Fabien Potencier b08968fecf feature #4469 Fix SafeAnalysisNodeVisitor::getSafe() return value (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix SafeAnalysisNodeVisitor::getSafe() return value

`SafeAnalysisNodeVisitor::getSafe()` can return `[]` or `null`. Both mean the same thing, but `null` is partially supported as `EscaperNodeVisitor` does not support `null` everywhere (as the node visitor never set `safe` to `null`). But a third party might return `null`. This PR makes the code more robust by deprecating using `null`.

Commits
-------

c402debcb8 Fix EscapeNodeVisitor::isSafeFor()
2024-11-25 17:28:02 +01:00
Fabien Potencier c402debcb8 Fix EscapeNodeVisitor::isSafeFor() 2024-11-25 17:27:56 +01:00
Fabien Potencier b7dfe60398 minor #4470 Simplify code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify code

The current "optimizes" the generated code when possible, but it's probably useless (and removing the code makes compilation a bit faster):

```php
// Before
yield ((a) ? ("a") : ("b"));

// After
((a) ? (yield "a") : (yield "b"));
```

Commits
-------

e39a7af56e Simplify code
2024-11-25 17:27:03 +01:00
Fabien Potencier c192cbff74 Remove deprecation 2024-11-25 09:59:26 +01:00
Fabien Potencier ce20da6be9 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate not passing a Source to TokenStream
  Bump version
  Specify allow round methods
  Clarify documentation for escape filter
2024-11-25 09:58:55 +01:00
Fabien Potencier c0689e3e68 feature #4471 Deprecate not passing a Source to TokenStream (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate not passing a Source to TokenStream

Closes #4457

Commits
-------

e7e72ff090 Deprecate not passing a Source to TokenStream
2024-11-25 09:23:53 +01:00
Fabien Potencier 2c6ed57cb9 minor #4468 Remove PHP 8.1 polyfill (ruudk)
This PR was merged into the 4.x branch.

Discussion
----------

Remove PHP 8.1 polyfill

Not needed when the Twig 4 requires 8.2.

Commits
-------

077d7a54b6 Remove PHP 8.1 polyfill
2024-11-25 09:21:21 +01:00
Fabien Potencier e7e72ff090 Deprecate not passing a Source to TokenStream 2024-11-24 19:41:42 +01:00
Fabien Potencier e39a7af56e Simplify code 2024-11-23 10:51:09 +01:00
Fabien Potencier 74aff6bb38 Bump version 2024-11-23 09:08:39 +01:00
Fabien Potencier cd611c144d minor #4431 Specify allow round methods (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Specify allow round methods

This way, PHPStan can validate invalid input.

Commits
-------

fb43e7a854 Specify allow round methods
2024-11-23 09:07:32 +01:00
Ruud Kamphuis 077d7a54b6 Remove PHP 8.1 polyfill
Not needed when the Twig 4 requires 8.2.
2024-11-22 19:18:22 +01:00