Skip to content

Commit 6157b91

Browse files
Merge branch '4.2'
* 4.2: [Console] Fix command testing with missing inputs [Validator] Sync no/nb translation files [Translation] Added a script to display the status of translations [Validator] Added missing translations for Norwegian (\"no\") locale #30179 [Security\Guard] bump lowest version of security-core [TwigBridge] Fix test Remove unnecessary ProgressBar stdout writes (fixes flickering) [Validator] improve translations for albanian ("sq") locale [VarDumper] fix serializing Stub instances [Validator] Added missing use statement for UnexpectedTypeException Don't resolve the Deprecation error handler mode until a deprecation is triggered bug #30245 fix lost namespace in eval (fizzka) fix lost namespace in eval [Twig] removed usage of non-namespaced classes added missing dot Update validators.lt.xlf #30172 Add the missing validation translations for the Luxembourgish … [Debug][ErrorHandler] Preserve next error handler
2 parents 6ba351a + c6f47ef commit 6157b91

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

DataCollector/TwigDataCollector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1717
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
1818
use Twig\Environment;
19+
use Twig\Error\LoaderError;
1920
use Twig\Markup;
2021
use Twig\Profiler\Dumper\HtmlDumper;
2122
use Twig\Profiler\Profile;
@@ -70,7 +71,7 @@ public function lateCollect()
7071
if ($profile->isTemplate()) {
7172
try {
7273
$template = $this->twig->load($name = $profile->getName());
73-
} catch (\Twig_Error_Loader $e) {
74+
} catch (LoaderError $e) {
7475
$template = null;
7576
}
7677

Tests/Node/TransNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function getVariableGetterWithoutStrictCheck($name)
5050
protected function getVariableGetterWithStrictCheck($name)
5151
{
5252
if (Environment::MAJOR_VERSION >= 2) {
53-
return sprintf('(isset($context["%1$s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new %2$s(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name, Environment::VERSION_ID >= 20700 ? '\Twig\Error\RuntimeError' : 'Twig_Error_Runtime');
53+
return sprintf('(isset($context["%1$s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new %2$s(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name, Environment::VERSION_ID >= 20700 ? 'RuntimeError' : 'Twig_Error_Runtime');
5454
}
5555

5656
return sprintf('($context["%s"] ?? $this->getContext($context, "%1$s"))', $name);

0 commit comments

Comments
 (0)