mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -24,7 +24,9 @@ class UndefinedCallableHandler
|
||||
{
|
||||
private const FILTER_COMPONENTS = [
|
||||
'humanize' => 'form',
|
||||
'form_encode_currency' => 'form',
|
||||
'trans' => 'translation',
|
||||
'sanitize_html' => 'html-sanitizer',
|
||||
'yaml_encode' => 'yaml',
|
||||
'yaml_dump' => 'yaml',
|
||||
];
|
||||
@@ -32,6 +34,7 @@ class UndefinedCallableHandler
|
||||
private const FUNCTION_COMPONENTS = [
|
||||
'asset' => 'asset',
|
||||
'asset_version' => 'asset',
|
||||
'importmap' => 'asset-mapper',
|
||||
'dump' => 'debug-bundle',
|
||||
'encore_entry_link_tags' => 'webpack-encore-bundle',
|
||||
'encore_entry_script_tags' => 'webpack-encore-bundle',
|
||||
@@ -46,6 +49,13 @@ class UndefinedCallableHandler
|
||||
'form_start' => 'form',
|
||||
'form_end' => 'form',
|
||||
'csrf_token' => 'form',
|
||||
'form_parent' => 'form',
|
||||
'field_name' => 'form',
|
||||
'field_value' => 'form',
|
||||
'field_label' => 'form',
|
||||
'field_help' => 'form',
|
||||
'field_errors' => 'form',
|
||||
'field_choices' => 'form',
|
||||
'logout_url' => 'security-http',
|
||||
'logout_path' => 'security-http',
|
||||
'is_granted' => 'security-core',
|
||||
@@ -57,11 +67,15 @@ class UndefinedCallableHandler
|
||||
'prerender' => 'web-link',
|
||||
'workflow_can' => 'workflow',
|
||||
'workflow_transitions' => 'workflow',
|
||||
'workflow_transition' => 'workflow',
|
||||
'workflow_has_marked_place' => 'workflow',
|
||||
'workflow_marked_places' => 'workflow',
|
||||
'workflow_metadata' => 'workflow',
|
||||
'workflow_transition_blockers' => 'workflow',
|
||||
];
|
||||
|
||||
private const FULL_STACK_ENABLE = [
|
||||
'html-sanitizer' => 'enable "framework.html_sanitizer"',
|
||||
'form' => 'enable "framework.form"',
|
||||
'security-core' => 'add the "SecurityBundle"',
|
||||
'security-http' => 'add the "SecurityBundle"',
|
||||
@@ -69,10 +83,7 @@ class UndefinedCallableHandler
|
||||
'workflow' => 'enable "framework.workflows"',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return TwigFilter|false
|
||||
*/
|
||||
public static function onUndefinedFilter(string $name)
|
||||
public static function onUndefinedFilter(string $name): TwigFilter|false
|
||||
{
|
||||
if (!isset(self::FILTER_COMPONENTS[$name])) {
|
||||
return false;
|
||||
@@ -81,17 +92,14 @@ class UndefinedCallableHandler
|
||||
throw new SyntaxError(self::onUndefined($name, 'filter', self::FILTER_COMPONENTS[$name]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TwigFunction|false
|
||||
*/
|
||||
public static function onUndefinedFunction(string $name)
|
||||
public static function onUndefinedFunction(string $name): TwigFunction|false
|
||||
{
|
||||
if (!isset(self::FUNCTION_COMPONENTS[$name])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('webpack-encore-bundle' === self::FUNCTION_COMPONENTS[$name]) {
|
||||
return new TwigFunction($name, static function () { return ''; });
|
||||
return new TwigFunction($name, static fn () => '');
|
||||
}
|
||||
|
||||
throw new SyntaxError(self::onUndefined($name, 'function', self::FUNCTION_COMPONENTS[$name]));
|
||||
|
||||
Reference in New Issue
Block a user