Skip to content

[TwigBundle] bump the required Twig bridge version #60304

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
May 2, 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use Symfony\Component\Form\FormRenderer;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Twig\Environment;

class TwigExtensionTest extends TestCase
Expand All @@ -54,6 +55,12 @@ public function testLoadEmptyConfiguration()
if (class_exists(Mailer::class)) {
$this->assertCount(2, $container->getDefinition('twig.mime_body_renderer')->getArguments());
}

if (interface_exists(ValidatorInterface::class)) {
$this->assertTrue($container->hasDefinition('twig.validator'));
} else {
$this->assertFalse($container->hasDefinition('twig.validator'));
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function registerBundles(): iterable
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(static function (ContainerBuilder $container) {
$container->setParameter('kernel.secret', 'secret');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lowest installed Twig version that is now installed is 3.21. This means that this test is not skipped anymore, but since FrameworkBundle 6.4 is installed we also need the kernel.secret parameter to be set as the uri_signer is not lazy (this was changed with #59086 in Symfony 7.2).

$container->register(StaticExtensionWithAttributes::class, StaticExtensionWithAttributes::class)
->setAutoconfigured(true);
$container->register(RuntimeExtensionWithAttributes::class, RuntimeExtensionWithAttributes::class)
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/TwigBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"composer-runtime-api": ">=2.1",
"symfony/config": "^7.3",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/twig-bridge": "^6.4|^7.0",
"symfony/twig-bridge": "^7.3",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"twig/twig": "^3.12"
Expand Down
Loading