Skip to content

Commit ec8da63

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [String] Fix snake conversion [DowCrawler] Fix locale-sensitivity of whitespace normalization suggest to install the Twig bundle when the required component is already installed Update PULL_REQUEST_TEMPLATE.md [Serializer] Fix throwing right exception in ArrayDenormalizer with invalid type
2 parents e16ffa5 + 4c35aca commit ec8da63

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

UndefinedCallableHandler.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Twig;
1313

14+
use Composer\InstalledVersions;
1415
use Symfony\Bundle\FullStack;
1516
use Twig\Error\SyntaxError;
1617
use Twig\TwigFilter;
@@ -98,6 +99,12 @@ private static function onUndefined(string $name, string $type, string $componen
9899
return sprintf('Did you forget to %s? Unknown %s "%s".', self::FULL_STACK_ENABLE[$component], $type, $name);
99100
}
100101

101-
return sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name);
102+
$missingPackage = 'symfony/'.$component;
103+
104+
if (class_exists(InstalledVersions::class) && InstalledVersions::isInstalled($missingPackage)) {
105+
$missingPackage = 'symfony/twig-bundle';
106+
}
107+
108+
return sprintf('Did you forget to run "composer require %s"? Unknown %s "%s".', $missingPackage, $type, $name);
102109
}
103110
}

0 commit comments

Comments
 (0)