Christian Flothmann
e31a6e4534
use EmptyNode instead of an Nodes instance without children
2025-02-28 22:12:08 +01:00
Alexandre Daubois
81c1fcc7d6
Fix ModuleNode instanciation when $embeddedTemplates is null
2025-02-28 20:12:40 +01:00
Fabien Potencier
3d760aec1c
Avoid polluting ModuleNode::toString() with embedded templates
2025-02-28 08:57:55 +01:00
Fabien Potencier
d7702840da
Remove $templateName from Template::loadTemplate()
2025-02-21 23:48:41 +01:00
Simon André
82be13429c
Add return type annotations on Twig 3 to prepare Twig 4
2025-01-24 11:32:59 +01:00
Simon André
81ebebb210
Remove dead method in ModuleNode
...
This method is not used after 1.x (it was used in the compileConstructor)https://github.com/twigphp/Twig/blob/b1f009c449e435a0384814e67205d9190a4d050e/src/Node/ModuleNode.php#L206 and has no caller since 2.x https://github.com/twigphp/Twig/blob/19185947ec75d433a3ac650af32fc05649b95ee1/src/Node/ModuleNode.php#L174
ModuleNode is marked final so I guess we can remove it safely.
2025-01-02 07:17:52 +01:00
Fabien Potencier
14fc89ebea
Fix CS
2024-11-30 09:42:13 +01:00
Fabien Potencier
ff55f590e7
Forbid adding Nodes to EmptyNode
2024-11-21 08:47:22 +01:00
Fabien Potencier
494f010d29
Revert "minor #4411 Add return type to getDebugInfo (ruudk)"
...
This reverts commit 868b429853 , reversing
changes made to b0017ad8c3 .
2024-10-25 16:01:04 +02:00
Ruud Kamphuis
0bb49dc40f
Add return type to getDebugInfo
2024-10-24 13:37:17 +02:00
Fabien Potencier
8b278986b8
Deprecate using Node directly, introduce EmptyNode and Nodes
2024-09-27 07:42:41 +02:00
Fabien Potencier
955611d5bb
Fix the possibility to override an aliased block (via use)
2024-09-25 22:08:16 +02:00
Fabien Potencier
28dc912c0e
Remove unused private methods
2024-09-09 08:24:03 +02:00
Ruud Kamphuis
09a43a9f6f
Replace return; yield with yield from []
...
This has the same effect, but looks less hacky and makes PHPStan happy.
https://phpstan.org/r/df7fcc88-1df8-428e-b675-5dc6965c34d6
Previously this was needed to work properly with output capturing.
2024-09-03 09:55:58 +02:00
Ruud Kamphuis
7e52a68097
Add more types to Template class and compiled templates
2024-08-30 16:17:55 +02:00
Ruud Kamphuis
bb8b9c197c
Add return type isTraitable
2024-08-29 10:29:47 +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
51e93aa130
Deprecate not passing a BodyNode instance as the body of a ModuleNode constructor
2024-08-24 10:49:53 +02:00
Fabien Potencier
313303b366
Update a phpdoc (ModuleNode is final now)
2024-08-24 09:53:44 +02:00
Fabien Potencier
b63bde3063
Optimize sprintf() calls for PHP 8.4
2024-06-21 08:16:55 +02:00
Gildas de Cadoudal
6c6315263e
fix : #4033 add missing unwrap call when a TemplateWrapper instance can be present
2024-04-18 11:47:39 +02:00
Fabien Potencier
3ca9685f58
Fix usage of display_end hook
2024-04-17 08:50:57 -04:00
Nicolas Grekas
b46e93c725
Minor fixes
2024-02-15 12:09:06 +01: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
7e1945a618
minor #3991 Fix some errors reported by phpstan (fabpot)
...
This PR was merged into the 3.x branch.
Discussion
----------
Fix some errors reported by phpstan
Commits
-------
2b2ac80d Fxi some errors reported by phpstan
2024-02-05 18:59:35 +01:00
Fabien Potencier
2b2ac80d34
Fxi some errors reported by phpstan
2024-02-05 17:48:36 +01:00
Fabien Potencier
0d3a283907
Tweak code
2024-01-25 13:09:58 +01:00
Fabien Potencier
1469e6a6bc
Add support for templates that do not have output Nodes
2024-01-25 13:09:58 +01:00
Fabien Potencier
3b6cbf98d8
Remove usage of ob_* functions in favor of yielding
2024-01-25 13:09:52 +01:00
Fabien Potencier
54d34b969b
Move functions for CoreExtension
2023-12-10 20:13:10 +01:00
Fabien Potencier
4be326aeeb
Fix tests and CS
2023-11-21 14:57:52 +01:00
Mark Huot
1cf610bd2a
Add @codeCoverageIgnore to untestable compiled methods
2022-04-30 04:49:45 -04:00
Nicolas Grekas
3aa40a42b3
Merge branch '2.x' into 3.x
...
* 2.x:
Try running all tests on nightly
Minor fixes
Fix Travis config
2020-05-21 11:56:39 +02:00
Nicolas Grekas
791f001ae6
Merge branch '1.x' into 2.x
...
* 1.x:
Minor fixes
2020-05-21 11:15:20 +02:00
Nicolas Grekas
5dc364469b
Minor fixes
2020-05-21 11:01:36 +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
54cec4e3b8
added type hints
2019-04-26 12:01:21 +02:00
Fabien Potencier
ebbe58793c
feature #2959 Remove the "base_template_class" option on Twig\Environment (fabpot)
...
This PR was merged into the 3.x branch.
Discussion
----------
Remove the "base_template_class" option on Twig\Environment
Commits
-------
86eb15de removed the "base_template_class" option on Twig\Environment
2019-04-23 18:25:58 +02:00
Fabien Potencier
86eb15dede
removed the "base_template_class" option on Twig\Environment
2019-04-23 17:42:53 +02:00
Fabien Potencier
e8a21cfe97
changed classes marked as @final to final
2019-04-23 17:10:12 +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
71bc632ab2
deprecated Node::setTemplateName()
2019-04-16 14:41:14 +02:00
Fabien Potencier
c576797ebc
simplified code
2019-04-12 12:19:21 +02:00
Fabien Potencier
243024d4e8
fixed CS
2019-04-12 12:16:59 +02:00
Fabien Potencier
95b8ac3501
fixed bad merge
2019-04-12 12:16:31 +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
67ffbe5b7e
Merge branch '1.x' into 2.x
...
* 1.x:
fixed "include" with "ignore missing" when an error loading occurs in the included template (again)
fixed "include" with "ignore missing" when an error loading occurs in the included template
2019-04-06 16:41:57 +02:00