Skip to content

Commit dd2b162

Browse files
Merge branch '5.4' into 6.0
* 5.4: (29 commits) [DI] fix fixture [ErrorHandler] fix handling buffered SilencedErrorContext [HttpClient] fix Psr18Client when allow_url_fopen=0 [DependencyInjection] Add support of PHP enumerations [Cache] handle prefixed redis connections when clearing pools [Cache] fix eventual consistency when using RedisTagAwareAdapter with a cluster [Uid] Prevent double validation in Uuid::fromString() with base32 values [Uid] Fix fromString() with low base58 values [Notifier] Add options to Microsoft Teams notifier [Notifier] Add Telnyx notifier bridge [Validator][Translation] Add ExpressionLanguageSyntax en and fr [HttpKernel] [HttpCache] Keep s-maxage=0 from ESI sub-responses Avoid broken action URL in text notification mail [FrameworkBundle] Add commented base64 version of secrets' keys [WebProfilerBundle] Improved the light/dark theme switching Fix references to CheckRememberMeConditionsListener [DependencyInjection] accept service locator definitions with no class [Cache] Disable locking on Windows by default [HttpClient] Add default base_uri to MockHttpClient [DependencyInjection] Fix binding "iterable $foo" when using the PHP-DSL ...
2 parents e47f4ae + 66e3f2d commit dd2b162

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

Resources/views/Email/zurb_2/notification/body.txt.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
{% block action %}
1010
{% if action_url %}
11-
{{ action_url }}: {{ action_text }}
11+
{{ action_text }}: {{ action_url }}
1212
{% endif %}
1313
{% endblock %}
1414

UndefinedCallableHandler.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Bundle\FullStack;
1515
use Twig\Error\SyntaxError;
16+
use Twig\TwigFilter;
17+
use Twig\TwigFunction;
1618

1719
/**
1820
* @internal
@@ -30,6 +32,8 @@ class UndefinedCallableHandler
3032
'asset' => 'asset',
3133
'asset_version' => 'asset',
3234
'dump' => 'debug-bundle',
35+
'encore_entry_link_tags' => 'webpack-encore-bundle',
36+
'encore_entry_script_tags' => 'webpack-encore-bundle',
3337
'expression' => 'expression-language',
3438
'form_widget' => 'form',
3539
'form_errors' => 'form',
@@ -64,34 +68,40 @@ class UndefinedCallableHandler
6468
'workflow' => 'enable "framework.workflows"',
6569
];
6670

67-
public static function onUndefinedFilter(string $name): bool
71+
/**
72+
* @return TwigFilter|false
73+
*/
74+
public static function onUndefinedFilter(string $name)
6875
{
6976
if (!isset(self::FILTER_COMPONENTS[$name])) {
7077
return false;
7178
}
7279

73-
self::onUndefined($name, 'filter', self::FILTER_COMPONENTS[$name]);
74-
75-
return true;
80+
throw new SyntaxError(self::onUndefined($name, 'filter', self::FILTER_COMPONENTS[$name]));
7681
}
7782

78-
public static function onUndefinedFunction(string $name): bool
83+
/**
84+
* @return TwigFunction|false
85+
*/
86+
public static function onUndefinedFunction(string $name)
7987
{
8088
if (!isset(self::FUNCTION_COMPONENTS[$name])) {
8189
return false;
8290
}
8391

84-
self::onUndefined($name, 'function', self::FUNCTION_COMPONENTS[$name]);
92+
if ('webpack-encore-bundle' === self::FUNCTION_COMPONENTS[$name]) {
93+
return new TwigFunction($name, static function () { return ''; });
94+
}
8595

86-
return true;
96+
throw new SyntaxError(self::onUndefined($name, 'function', self::FUNCTION_COMPONENTS[$name]));
8797
}
8898

89-
private static function onUndefined(string $name, string $type, string $component)
99+
private static function onUndefined(string $name, string $type, string $component): string
90100
{
91101
if (class_exists(FullStack::class) && isset(self::FULL_STACK_ENABLE[$component])) {
92-
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::FULL_STACK_ENABLE[$component], $type, $name));
102+
return sprintf('Did you forget to %s? Unknown %s "%s".', self::FULL_STACK_ENABLE[$component], $type, $name);
93103
}
94104

95-
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name));
105+
return sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name);
96106
}
97107
}

0 commit comments

Comments
 (0)