Commit Graph

128 Commits

Author SHA1 Message Date
Fabien Potencier cde9e7dcd4 Use proper node names when they are integers 2024-08-26 09:59:54 +02:00
Fabien Potencier d1f9097c7b Merge branch '3.x' into 4.x
* 3.x:
  Deprecate some internal methods from Parser
  Move code from ExtendsTokenParser to Parser
  Update Node::__toString() to include the node tag if set
  Fix class name
  Fix error message
2024-08-26 09:28:17 +02:00
Fabien Potencier 157d36ae43 Update Node::__toString() to include the node tag if set 2024-08-24 17:28:38 +02:00
Fabien Potencier b858e61ddb Merge branch '3.x' into 4.x
* 3.x:
  Deprecate not passing a BodyNode instance as the body of a ModuleNode constructor
  Update a phpdoc (ModuleNode is final now)
2024-08-24 10:50:41 +02:00
Fabien Potencier 51e93aa130 Deprecate not passing a BodyNode instance as the body of a ModuleNode constructor 2024-08-24 10:49:53 +02:00
Fabien Potencier 31037d0e51 Refactor code 2024-08-20 15:39:54 +02:00
Fabien Potencier 15c0adb3ed Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-08-18 19:26:04 +02:00
Fabien Potencier 675cb2d141 Fix CS 2024-08-18 19:25:19 +02:00
Fabien Potencier d051ccde20 Merge branch '3.x' into 4.x
* 3.x:
  Throw a SyntaxError exception at compile time when a Twig callable has not the minimum number of required arguments
2024-08-16 08:12:37 +02:00
Fabien Potencier 0823d23488 Throw a SyntaxError exception at compile time when a Twig callable has not the minimum number of required arguments 2024-08-15 23:00:02 +02:00
Fabien Potencier a30d07eeb4 Remove obsolete code 2024-08-15 20:59:30 +02:00
Fabien Potencier 4bade436a4 Merge branch '3.x' into 4.x
* 3.x:
  Extract a new CallableArgumentsExtractor class
  Make Node::__toString() more readable
2024-08-15 20:57:57 +02:00
Fabien Potencier e1705f8831 Extract a new CallableArgumentsExtractor class 2024-08-15 20:37:59 +02:00
Fabien Potencier b431ecad3a Make Node::__toString() more readable 2024-08-15 20:18:30 +02:00
Fabien Potencier eaf04e53f0 Remove deprecated code 2024-08-14 23:34:13 +02:00
Fabien Potencier abee6fc583 Merge branch '3.x' into 4.x
* 3.x:
  Move FunctionExpression/FilterExpression/TestExpression attributes from compilation time to parsing time
  Cleanup the implementation of the defined test for constants
2024-08-14 23:07:43 +02:00
Fabien Potencier 3156d8093e Move FunctionExpression/FilterExpression/TestExpression attributes from compilation time to parsing time 2024-08-14 18:45:35 +02:00
Fabien Potencier 91f29731d4 Merge branch '3.x' into 4.x
* 3.x:
  Optimize stripcslashes
  (minor) Prefer `className` over `classname`
  Remove escape
  Deprecate unnecessary escape characters
  Micro-micro optimization
  Simplify tests
2024-08-12 09:28:43 +02:00
Fabien Potencier 8a8f22131c Simplify tests 2024-08-10 18:25:26 +02:00
Fabien Potencier 102bec30f6 Merge branch '3.x' into 4.x
* 3.x:
  Add the possibility to deprecate attributes and nodes on Node
2024-08-08 14:50:31 +02:00
Fabien Potencier 18894cf91e Add the possibility to deprecate attributes and nodes on Node 2024-08-08 14:48:20 +02:00
Fabien Potencier eafbee52e3 Merge branch '3.x' into 4.x
* 3.x:
  Use trigger_deprecation() instead of trigger_error() for deprecations
  Tweak docs
  clarify that macros shadow other macros/functions
2024-08-08 14:47:26 +02:00
Fabien Potencier 0ce79df5c4 Use trigger_deprecation() instead of trigger_error() for deprecations 2024-08-08 14:28:28 +02:00
Fabien Potencier a5882760df Fix CS 2024-08-07 19:37:53 +02:00
Fabien Potencier 0131c230c7 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-08-07 19:34:39 +02:00
Fabien Potencier f5e10e10f1 Fix CS 2024-08-07 19:34:09 +02:00
Fabien Potencier 2be34fc0ce Merge branch '3.x' into 4.x
* 3.x:
  Introduce ChainCache and ReadOnlyFilesystemCache
  Add a note about how macros can override existing functions
  Fix dumping callables on Node::__toString()
2024-08-07 14:41:48 +02:00
Fabien Potencier fc64472145 Fix dumping callables on Node::__toString() 2024-08-04 16:35:01 +02:00
Fabien Potencier b36d9bb7ed Merge branch '3.x' into 4.x
* 3.x:
  Simplify usage of RawFilter
2024-07-28 11:11:24 +02:00
Fabien Potencier 6e55b5f956 Simplify usage of RawFilter 2024-07-28 11:10:04 +02:00
Fabien Potencier fa1a217f1a Add another test 2024-07-28 10:08:38 +02:00
Fabien Potencier 036c9943db Don't unset loop when it's not defined 2024-07-28 10:08:38 +02:00
Fabien Potencier 1b9baa764b Remove usage of the internal _parent context variable in loops 2024-07-28 10:08:38 +02:00
Fabien Potencier e95d6b2f21 Add support for recursive loops 2024-07-28 10:08:35 +02:00
Fabien Potencier 03fbac566a Fix test 2024-07-27 17:07:17 +02:00
Fabien Potencier 02ab3a185e Merge branch '3.x' into 4.x
* 3.x:
  Add support for yielding from a generator in PrintNode
2024-07-27 17:01:23 +02:00
Fabien Potencier 27f6171f2f Add support for yielding from a generator in PrintNode 2024-07-27 16:57:14 +02:00
Fabien Potencier 8951b8f73a Remove unneeded PHP version check 2024-07-24 13:08:43 +02:00
Fabien Potencier 6b0f2e78c2 Merge branch '3.x' into 4.x
* 3.x:
  Refactor some tests
2024-07-24 13:03:11 +02:00
Fabien Potencier 76dcc75982 Merge branch '3.x' into 4.x
* 3.x:
  Replace template loader mocks by ArrayLoader
  [Doc] Fix javascript code-block
2024-07-24 09:53:24 +02:00
Fabien Potencier ebcd5034ee Refactor some tests 2024-07-24 08:44:11 +02:00
Fabien Potencier a656293915 minor #4150 Replace template loader mocks by ArrayLoader (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Replace template loader mocks by ArrayLoader

Commits
-------

e4e95f5b Replace template loader mocks by ArrayLoader
2024-07-24 08:31:51 +02:00
Fabien Potencier e4e95f5b86 Replace template loader mocks by ArrayLoader 2024-07-24 08:27:23 +02:00
Fabien Potencier 7f0f313f1a Make some small internal tweaks to loops 2024-07-18 08:26:46 +02:00
Fabien Potencier fcb36ec18a Merge branch '3.x' into 4.x
* 3.x:
  Add support for first class callables
2024-07-14 13:59:52 +02:00
Fabien Potencier d2eab12e70 Add support for first class callables 2024-07-14 13:56:14 +02:00
Fabien Potencier 65b4ea4394 Add loop.changed, loop.previous, loop.next, and loop.cycle variables 2024-07-12 11:13:02 +02:00
Fabien Potencier 437ad31dfa Move some code to LoopContext 2024-07-11 09:35:26 +02:00
Fabien Potencier 17ef0bef4b Introduce a Loop object 2024-07-11 08:03:08 +02:00
Fabien Potencier c250afdda0 Optimize sprintf() calls for PHP 8.4 2024-06-21 08:27:51 +02:00