Commit Graph

7180 Commits

Author SHA1 Message Date
Fabien Potencier d1bc1cb461 minor #4380 Remove remaining usages of get_class() (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Remove remaining usages of get_class()

Commits
-------

cf603b19c1 Remove remaining usages of get_class()
2024-10-05 10:03:12 +02:00
Fabien Potencier cf603b19c1 Remove remaining usages of get_class() 2024-10-05 09:33:37 +02:00
Fabien Potencier e98b10a802 Remove obsolete code 2024-10-04 21:08:34 +02:00
Fabien Potencier 43de153213 Merge branch '3.x' into 4.x
* 3.x:
  Move sandbox docs to its own chapter in the docs
  Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)
  Fix markup
  Update html_cva.rst
  Fix markup
  Fix markup
  Added informations in format_currency and format_number docs
  Clarify docs for some operators
2024-10-04 21:05:35 +02:00
Fabien Potencier 5ac03a440c minor #4376 Move sandbox docs to its own chapter in the docs (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Move sandbox docs to its own chapter in the docs

I've also added more information about potential security issues when exposing something that takes a callable as an argument.

Commits
-------

6688a8df16 Move sandbox docs to its own chapter in the docs
2024-10-04 21:01:30 +02:00
Fabien Potencier 6688a8df16 Move sandbox docs to its own chapter in the docs 2024-10-04 21:00:19 +02:00
Fabien Potencier 1876635d23 feature #4377 Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure) (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)

Instead of restricting callable arguments only in sandbox mode, let's deprecate using functions/arrays as callables.

Commits
-------

5e9448310d Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)
2024-10-04 20:59:44 +02:00
Fabien Potencier 5e9448310d Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure) 2024-10-04 18:51:37 +02:00
Fabien Potencier f363ab258b Fix markup 2024-10-04 08:05:19 +02:00
Fabien Potencier 62c0282d61 minor #4374 [Doc] html_cva (seb-jean)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] html_cva

Juste rename defaultVariant without "s".

Commits
-------

86b23eba23 Update html_cva.rst
2024-10-04 07:42:27 +02:00
seb-jean 86b23eba23 Update html_cva.rst 2024-10-04 07:32:20 +02:00
Fabien Potencier 53441af5ff Fix markup 2024-10-03 14:23:13 +02:00
Fabien Potencier c4d4141187 Fix markup 2024-10-03 14:09:21 +02:00
Fabien Potencier fc49d2f153 minor #3985 Added informations in format_currency and format_number docs (FlorianChenot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Added informations in format_currency and format_number docs

Commits
-------

e08ca837df Added informations in format_currency and format_number docs
2024-10-03 14:01:13 +02:00
unknown e08ca837df Added informations in format_currency and format_number docs 2024-10-03 14:00:37 +02:00
Fabien Potencier 69c2202081 minor #4372 Clarify docs for some operators (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Clarify docs for some operators

Closes #3922

Commits
-------

0d73fd232a Clarify docs for some operators
2024-10-02 16:18:34 +02:00
Fabien Potencier 0d73fd232a Clarify docs for some operators 2024-10-02 15:48:38 +02:00
Fabien Potencier dc657da5a6 Fix docs about operator precedence 2024-10-02 14:58:00 +02:00
Fabien Potencier 0d7a3cc49e Remove obsolete code 2024-10-02 14:22:18 +02:00
Fabien Potencier 14216a8d68 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate using the not unary operator without parenthesis
  Deprecate using ?? without explicit parentheses
  Add support for logical `xor` operator
  Allow running CI on all branches
  [Doc] Fix enum title
  Document Twig vs PHP types
2024-10-02 14:19:28 +02:00
Fabien Potencier 247658c730 feature #4367 Trigger deprecations when using "??" and "not" without explicit parentheses when precedence will change in 4.0 (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Trigger deprecations when using "??" and "not" without explicit parentheses when precedence will change in 4.0

Closes #3387
Closes #3642

Commits
-------

2081b1ff74 Deprecate using the not unary operator without parenthesis
f4aacafd78 Deprecate using ?? without explicit parentheses
2024-10-02 14:17:10 +02:00
Fabien Potencier 2081b1ff74 Deprecate using the not unary operator without parenthesis 2024-10-02 14:16:34 +02:00
Fabien Potencier 915dea1f7c feature #4369 Add support for logical xor operator (HypeMC)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for logical `xor` operator

Adds support for the logical `xor` operator

Commits
-------

8893944e0c Add support for logical `xor` operator
2024-10-02 10:02:50 +02:00
Fabien Potencier f4aacafd78 Deprecate using ?? without explicit parentheses 2024-10-01 21:58:05 +02:00
HypeMC 8893944e0c Add support for logical xor operator 2024-10-01 20:43:59 +02:00
Fabien Potencier 7d74d28e2e minor #4371 Allow running CI on all branches (HypeMC)
This PR was merged into the 3.x branch.

Discussion
----------

Allow running CI on all branches

This allows contributors to verify if the CI passes on their forks before opening a PR.

Commits
-------

6276d143c3 Allow running CI on all branches
2024-10-01 20:37:57 +02:00
HypeMC 6276d143c3 Allow running CI on all branches 2024-10-01 19:57:51 +02:00
Fabien Potencier a16053b4bf minor #4362 Document Twig vs PHP types (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Document Twig vs PHP types

Refs #4256

Commits
-------

9690e7bbbf Document Twig vs PHP types
2024-09-30 23:29:55 +02:00
Fabien Potencier 6980344bc6 minor #4368 [Doc] Fix enum title (nicolas-joubert)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Fix enum title

Copy/Paste fix from enum_case documentation page

Commits
-------

f16382ba91 [Doc] Fix enum title
2024-09-30 23:05:39 +02:00
nicolas-joubert f16382ba91 [Doc] Fix enum title
Copy/Paste fix from enum_case documentation page
2024-09-30 23:05:34 +02:00
Fabien Potencier 9690e7bbbf Document Twig vs PHP types 2024-09-30 23:04:32 +02:00
Fabien Potencier baab14823c Remove obsolete code 2024-09-30 22:51:32 +02:00
Fabien Potencier 5194101f12 Merge branch '3.x' into 4.x
* 3.x:
  Refactor code
  Add some type hints
  Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence
  Change some type hints to be more precise
  Deprecate not passing AbstractExpression args to most constructor arguments for classes extending AbstractExpression
  Remove obsolete method
  Add support for detecting if an expression had explicit parentheses
  Fix tests
  Unify error messages when a filter expects a mapping/sequence
2024-09-30 22:46:04 +02:00
Fabien Potencier b93eb3ce58 Refactor code 2024-09-30 14:05:03 +02:00
Fabien Potencier 9f8c52d022 Add some type hints 2024-09-30 14:02:17 +02:00
Fabien Potencier a0d52fd41f feature #4363 Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence

See https://wiki.php.net/rfc/concatenation_precedence for the related change in PHP 7.4.

Commits
-------

816c510cef Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence
2024-09-30 13:59:28 +02:00
Fabien Potencier e80f8fe3b1 minor #4366 Change some type hints to be more precise (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Change some type hints to be more precise

Commits
-------

43b6e098df Change some type hints to be more precise
2024-09-30 13:52:50 +02:00
Fabien Potencier 816c510cef Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence 2024-09-30 13:51:47 +02:00
Fabien Potencier 43b6e098df Change some type hints to be more precise 2024-09-30 13:47:10 +02:00
Fabien Potencier fa8050b24f feature #4364 Deprecate not passing AbstractExpression args to most constructor arguments for classes extending AbstractExpression (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate not passing AbstractExpression args to most constructor arguments for classes extending AbstractExpression

Commits
-------

824143d5e5 Deprecate not passing AbstractExpression args to most constructor arguments for classes extending AbstractExpression
2024-09-30 12:26:54 +02:00
Fabien Potencier 824143d5e5 Deprecate not passing AbstractExpression args to most constructor arguments for classes extending AbstractExpression 2024-09-30 12:15:47 +02:00
Fabien Potencier b46ca43f61 Remove obsolete method 2024-09-30 12:00:38 +02:00
Fabien Potencier e49768a3d7 minor #4365 Add support for detecting if an expression had explicit parentheses (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for detecting if an expression had explicit parentheses

It's going to help with operator precedence changes and their related deprecation notices.

Commits
-------

d133ab7e70 Add support for detecting if an expression had explicit parentheses
2024-09-30 11:58:51 +02:00
Fabien Potencier d133ab7e70 Add support for detecting if an expression had explicit parentheses 2024-09-30 11:55:38 +02:00
Fabien Potencier 4e08e3ef5f Fix tests 2024-09-30 08:41:48 +02:00
Fabien Potencier 191a138768 minor #4252 Unify error messages when a filter expects a mapping/sequence (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Unify error messages when a filter expects a mapping/sequence

Besides unifying the error messages, I've also removed the mention of `\Traversable` as this does not help and is an implementation detail (mapping and sequence are Twig terms, Traversable is not).

Or maybe we should introduce the notion of a "iterable"?

Commits
-------

c599125a39 Unify error messages when a filter expects a mapping/sequence
2024-09-29 18:30:09 +02:00
Fabien Potencier c599125a39 Unify error messages when a filter expects a mapping/sequence 2024-09-29 18:29:04 +02:00
Fabien Potencier 69f8cf7092 Merge branch '3.x' into 4.x
* 3.x:
  Add missing is_iterable() checks
  Fix tests
  Add quotes on filters/functions in CoreExtension
  Use get_debug_type() everywhere
2024-09-29 18:26:00 +02:00
Fabien Potencier 3523d34b50 Add missing is_iterable() checks 2024-09-29 18:23:14 +02:00
Fabien Potencier 0f47aa7d1f Fix tests 2024-09-29 18:22:59 +02:00