8000 [TwigBundle] fix auto-enabling assets/expression/routing/yaml/workflow extensions by nicolas-grekas · Pull Request #43801 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[TwigBundle] fix auto-enabling assets/expression/routing/yaml/workflow extensions #43801

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
Oct 28, 2021
Merged
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
[TwigBundle] fix auto-enabling assets/expression/routing/yaml/workflo…
…w extensions
  • Loading branch information
nicolas-grekas committed Oct 28, 2021
commit bd8256d3ebd59f8af1f3f45d73d097dbec28381f
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ class ExtensionPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container::willBeAvailable('symfony/asset', Packages::class, ['symfony/twig-bundle'])) {
if (!class_exists(Packages::class)) {
$container->removeDefinition('twig.extension.assets');
}

if (!$container::willBeAvailable('symfony/expression-language', Expression::class, ['symfony/twig-bundle'])) {
if (!class_exists(Expression::class)) {
$container->removeDefinition('twig.extension.expression');
}

if (!$container::willBeAvailable('symfony/routing', UrlGeneratorInterface::class, ['symfony/twig-bundle'])) {
if (!interface_exists(UrlGeneratorInterface::class)) {
$container->removeDefinition('twig.extension.routing');
}

if (!$container::willBeAvailable('symfony/yaml', Yaml::class, ['symfony/twig-bundle'])) {
if (!class_exists(Yaml::class)) {
$container->removeDefinition('twig.extension.yaml');
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public function process(ContainerBuilder $container)
$container->getDefinition('twig.extension.expression')->addTag('twig.extension');
}

if (!$container::willBeAvailable('symfony/workflow', Workflow::class, ['symfony/twig-bundle']) || !$container->has('workflow.registry')) {
if (!class_exists(Workflow::class) || !$container->has('workflow.registry')) {
$container->removeDefinition('workflow.twig_extension');
} else {
$container->getDefinition('workflow.twig_extension')->addTag('twig.extension');
Expand Down
0