8000 modify definitions only if the do exist · symfony/symfony@d753620 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d753620

Browse files
committed
modify definitions only if the do exist
If the `TranslatorPass` is used an application without the Console component, the commands will not be registered. Thus, their service definitions must not be modified.
1 parent a19d1e5 commit d753620

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php

Lines changed: 7 additions & 2 del AB41 etions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ public function process(ContainerBuilder $container)
8181
;
8282

8383
if ($container->hasParameter('twig.default_path')) {
84-
$container->getDefinition($this->debugCommandServiceId)->replaceArgument(4, $container->getParameter('twig.default_path'));
85-
$container->getDefinition($this->updateCommandServiceId)->replaceArgument(5, $container->getParameter('twig.default_path'));
84+
if ($container->hasDefinition($this->debugCommandServiceId)) {
85+
$container->getDefinition($this->debugCommandServiceId)->replaceArgument(4, $container->getParameter('twig.default_path'));
86+
}
87+
88+
if ($container->hasDefinition($this->updateCommandServiceId)) {
89+
$container->getDefinition($this->updateCommandServiceId)->replaceArgument(5, $container->getParameter('twig.default_path'));
90+
}
8691
}
8792
}
8893
}

0 commit comments

Comments
 (0)
0