Commit Graph

54 Commits

Author SHA1 Message Date
Fabien Potencier 82cde4edcb Fix CS 2024-11-30 09:45:07 +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 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 6f996fc214 Merge branch '3.x' into 4.x
* 3.x:
  Simplify enum usage in docs
  Forbid adding Nodes to EmptyNode
  Add phpstan analysis
  Fix the intl-extra tests
  Fix the string-extra tests when running with older symfony/string
  Fix the exception message to match the expected one for not ready nodes
  Add missing import
  Add BC break note in CHANGELOG for 3.15
  Fix CHANGELOG
  Update CHANGELOG
  Bump version
  Prepare the 3.15.0 release
2024-11-22 10:06:29 +01:00
Vincent Langlet 75d48db822 Add phpstan analysis 2024-11-20 20:05:33 +01:00
Fabien Potencier 429b13c9b0 Merge branch '3.x' into 4.x
* 3.x:
  Remove obsolete code
  Update CHANGELOG
  Sandbox ArrayAccess and do sandbox checks before isset() checks
  Fix sandbox handling for __toString()
  Fix mistake in docs for `keys` filter
  Update CHANGELOG
  [String] Add SpanishInflector support for singular and plural
  Add `find` to `Filters` docs
  Remove duplicate test case
  Revert "minor #4411 Add return type to getDebugInfo (ruudk)"
  Add `$this` return type to Template::unwrap
  Add link to TwigQI in docs "You might also be interested in" section
  Add return type to compiled macro
2024-11-06 21:52:30 +01:00
Ruud Kamphuis 1e7c719e24 Add return type to compiled macro
This makes it easier for TwigStan to analyze the return type.
2024-10-24 13:51:09 +02:00
Fabien Potencier ef63506239 Merge branch '3.x' into 4.x
* 3.x:
  Improve ImportNode impl
  Rename Node classes related to variables
2024-10-24 07:57:29 +02:00
Fabien Potencier fc15e7ccbc Rename Node classes related to variables 2024-10-23 12:36:57 +02:00
Fabien Potencier 5da4b58fc5 Merge branch '3.x' into 4.x
* 3.x:
  Check reserved names in TempNameExpression
2024-10-15 21:29:05 +02:00
Fabien Potencier 66658a3c1d Check reserved names in TempNameExpression 2024-10-14 19:42:47 +02:00
Fabien Potencier ea0ed28111 Merge branch '3.x' into 4.x
* 3.x:
  Add support for named arguments on macro calls and dot operator arguments
  Improve deprecation messages
  Simplify expression parser code
  Refactor expression parser
  chore: fix version added
  Cleanup code
2024-10-11 11:46:56 +02:00
Fabien Potencier 223d36bbae Add support for named arguments on macro calls and dot operator arguments 2024-10-11 11:31:40 +02:00
Fabien Potencier fa1c9f0bf9 Merge branch '3.x' into 4.x
* 3.x:
  Remove obsolete code
  Deprecate Environment::mergeGlobals()
  Bump version
  Prepare the 3.13.0 release
  Fix wrong format of `Environment::VERSION_ID` constant
  Fix minor things
  Fix CS
  Fix isset in ForLoopNode
  Fix iterable return type
  Improve exception expectations reliability
2024-09-07 17:03:10 +02:00
Fabien Potencier b86575cfd6 Deprecate Environment::mergeGlobals() 2024-09-07 14:05:02 +02:00
Fabien Potencier 978f749b43 Fix minor things 2024-09-06 12:58:38 +02:00
Fabien Potencier e2f0128774 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
  Clarify block function
2024-08-28 13:56:42 +02:00
Fabien Potencier 5fca700cbd Deprecate the fact that the extends and use tags are always allowed in a sandboxed template 2024-08-28 13:40:53 +02:00
Fabien Potencier 41459e0ddb Fix CS 2024-08-27 13:18:23 +02:00
Fabien Potencier 4b99692e2a Fix class name 2024-08-24 17:12:56 +02:00
Fabien Potencier dfd9d0faad Enforce more type hints 2024-08-24 10:51:35 +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 b63bde3063 Optimize sprintf() calls for PHP 8.4 2024-06-21 08:16:55 +02:00
Fabien Potencier d30b72c364 Fix blocks not available under some circumstancies 2024-05-11 08:44:27 +02:00
Fabien Potencier 64cebe0e0b Fix CaptureNode for some use cases 2024-04-17 04:57:55 -04:00
Nicolas Grekas e70777405d Add #[YieldReady] to allow extensions to tell when they're ready for yielding 2024-02-15 10:27:26 +01:00
Fabien Potencier f7f11ea410 Fix CS 2024-02-10 09:52:03 +01:00
Christian Flothmann 665dce899f rework the CaptureNode implementation 2024-01-01 15:43:59 +01:00
Fabien Potencier 6ebbc30593 Abstract node capture in its own Node 2023-12-30 10:14:36 +01:00
Fabien Potencier 13e360972a Merge branch '2.x' into 3.x
* 2.x:
  Fix CS
  Fix CS
  Migrate to the new PHP CS Fixer config file
  Fixing links
2021-05-12 09:45:40 +02:00
Fabien Potencier 157fa56829 Merge branch '1.x' into 2.x
* 1.x:
  Fix CS
  Migrate to the new PHP CS Fixer config file
2021-05-12 09:27:30 +02:00
Fabien Potencier 59f3e8e5dc Fix CS 2021-05-12 09:19:37 +02:00
Fabien Potencier 17bf2f0bfc Merge branch '2.x' into 3.x
* 2.x:
  Don't clear PHP buffer when an error occurs with debug=true
  Remove duplicate phpdoc
2019-06-10 19:37:42 +02:00
Fabien Potencier b957ff6f29 Merge branch '1.x' into 2.x
* 1.x:
  Don't clear PHP buffer when an error occurs with debug=true
  Remove duplicate phpdoc
2019-06-10 19:37:27 +02:00
Grégoire Pineau c910e71f5a Don't clear PHP buffer when an error occurs with debug=true 2019-06-10 19:36:53 +02:00
Fabien Potencier dce7bd9e14 Merge branch '2.x' into 3.x
* 2.x:
  macros imported "globally" in a template are now available in macros without re-importing them
  added more tests
  added some tests
2019-05-17 14:16:15 +02:00
Fabien Potencier e138164015 macros imported "globally" in a template are now available in macros without re-importing them 2019-05-17 13:03:55 +02:00
Fabien Potencier 3d1b9a11d8 Merge branch '2.x' into 3.x
* 2.x:
  fixed CS
  added the key to the map and filter filters
  added support for iterators
  removed fn in front of arrow functions
  changed arrow syntax
  added "filter", "map", and "reduce" filters
  simplified code
  fixed CS
  bumped version to 2.10
  bumped version to 1.41
  fixed partial output leak when a PHP fatal error occurs
  fixed markup in docs
2019-05-09 13:29:19 +02:00
Fabien Potencier 5c484ce7eb Merge branch '1.x' into 2.x
* 1.x:
  added the key to the map and filter filters
  added support for iterators
  removed fn in front of arrow functions
  changed arrow syntax
  added "filter", "map", and "reduce" filters
  simplified code
  fixed CS
  fixed partial output leak when a PHP fatal error occurs
2019-05-09 13:25:49 +02:00
Fabien Potencier 6196fe5b40 fixed partial output leak when a PHP fatal error occurs 2019-05-03 08:42:27 +02:00
Fabien Potencier 54cec4e3b8 added type hints 2019-04-26 12:01:21 +02:00
Fabien Potencier 273b666a71 removed the obsolete lib/ directory, removed PSR-0 class aliases 2019-04-23 16:34:05 +02:00
Fabien Potencier 1c80fa7205 Merge branch '1.x' into 2.x
* 1.x:
  added more tests
  added missing hints in some runtime exceptions
2019-04-12 12:08:49 +02:00
Fabien Potencier d4db91535d added missing hints in some runtime exceptions 2019-04-12 10:29:05 +02:00
Fabien Potencier 1dead73882 added some type hints on constructors 2019-03-16 15:26:39 +01:00
Fabien Potencier 2861b40965 Merge branch '1.x' into 2.x
* 1.x:
  removed -2 magic number
  tried to avoid guessing template info on errors
2019-03-11 16:18:55 +01:00
Fabien Potencier 2389faeae3 tried to avoid guessing template info on errors 2019-03-11 16:04:11 +01:00
Fabien Potencier 037ee67224 switched to namespace first, PSR-0 as a fallback 2019-03-05 08:14:45 +01:00