Skip to content

[TwigBridge] remove the ability to pass a tag to FormThemeNode #61048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UPGRADE-8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ Translation
TwigBridge
----------

* Remove support for passing a tag to the constructor of `FormThemeNode`
* Remove `text` format from the `debug:twig` command, use the `txt` format instead

TwigBundle
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Bridge/Twig/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

8.0
---

* Remove support for passing a tag to the constructor of `FormThemeNode`

7.3
---

Expand Down
12 changes: 1 addition & 11 deletions src/Symfony/Bridge/Twig/Node/FormThemeNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@
#[YieldReady]
final class FormThemeNode extends Node
{
/**
* @param bool $only
*/
public function __construct(Node $form, Node $resources, int $lineno, $only = false)
public function __construct(Node $form, Node $resources, int $lineno, bool $only = false)
{
if (null === $only || \is_string($only)) {
trigger_deprecation('symfony/twig-bridge', '3.12', 'Passing a tag to %s() is deprecated.', __METHOD__);
$only = \func_num_args() > 4 ? func_get_arg(4) : true;
} elseif (!\is_bool($only)) {
throw new \TypeError(\sprintf('Argument 4 passed to "%s()" must be a boolean, "%s" given.', __METHOD__, get_debug_type($only)));
}

parent::__construct(['form' => $form, 'resources' => $resources], ['only' => $only], $lineno);
}

Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Bridge/Twig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
],
"require": {
"php": ">=8.4",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/translation-contracts": "^2.5|^3",
"twig/twig": "^3.21"
},
Expand Down
Loading