-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
base: 7.3
Are you sure you want to change the base?
Conversation
xabbuh
commented
Apr 30, 2025
Q | A |
---|---|
Branch? | 7.3 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Issues | |
License | MIT |
@@ -70,7 +70,7 @@ public function load(array $configs, ContainerBuilder $container): void | |||
$container->removeDefinition('twig.translation.extractor'); | |||
} | |||
|
|||
if ($container::willBeAvailable('symfony/validator', Constraint::class, ['symfony/twig-bundle'])) { | |||
if ($container::willBeAvailable('symfony/twig-bridge', TwigValidator::class, ['symfony/twig-bundle'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
willBeAvailable
indicates whether a package is installed or not. Here the twig-bridge
package is always installed, but TwigValidator
is only available in version 7.3.
Maybe add both conditions:
if ($container::willBeAvailable('symfony/twig-bridge', TwigValidator::class, ['symfony/twig-bundle'])) { | |
if (class_exists(TwigValidator::class) && $container::willBeAvailable('symfony/validator', Constraint::class, ['symfony/twig-bundle'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's more direct to require symfony/twig-bridge: ^7.3
in symfony/twig-bundle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's more direct to require
symfony/twig-bridge: ^7.3
insymfony/twig-bundle
good point, let's do that instead
@@ -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'); |
There was a problem hiding this comment.
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).