mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 05:58:46 +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:
@@ -27,7 +27,7 @@ return static function (ContainerConfigurator $container) {
|
||||
->tag('console.command')
|
||||
|
||||
->set('twig.command.lint', LintCommand::class)
|
||||
->args([service('twig')])
|
||||
->args([service('twig'), abstract_arg('File name pattern')])
|
||||
->tag('console.command')
|
||||
;
|
||||
};
|
||||
|
||||
27
lib/symfony/twig-bundle/Resources/config/importmap.php
Normal file
27
lib/symfony/twig-bundle/Resources/config/importmap.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
|
||||
use Symfony\Bridge\Twig\Extension\ImportMapExtension;
|
||||
use Symfony\Bridge\Twig\Extension\ImportMapRuntime;
|
||||
|
||||
return static function (ContainerConfigurator $container) {
|
||||
$container->services()
|
||||
|
||||
->set('twig.runtime.importmap', ImportMapRuntime::class)
|
||||
->args([service('asset_mapper.importmap.renderer')])
|
||||
->tag('twig.runtime')
|
||||
|
||||
->set('twig.extension.importmap', ImportMapExtension::class)
|
||||
->tag('twig.extension')
|
||||
;
|
||||
};
|
||||
@@ -13,6 +13,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
|
||||
use Symfony\Bridge\Twig\Mime\BodyRenderer;
|
||||
use Symfony\Component\Mailer\EventListener\MessageListener;
|
||||
use Symfony\Component\Mime\BodyRendererInterface;
|
||||
|
||||
return static function (ContainerConfigurator $container) {
|
||||
$container->services()
|
||||
@@ -22,5 +23,6 @@ return static function (ContainerConfigurator $container) {
|
||||
|
||||
->set('twig.mime_body_renderer', BodyRenderer::class)
|
||||
->args([service('twig')])
|
||||
->alias(BodyRendererInterface::class, 'twig.mime_body_renderer')
|
||||
;
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<xsd:element name="form-theme" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="global" type="global" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="path" type="path" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="mailer" type="mailer" minOccurs="0" maxOccurs="1" />
|
||||
</xsd:sequence>
|
||||
|
||||
<xsd:attribute name="auto-reload" type="xsd:string" />
|
||||
@@ -55,4 +56,8 @@
|
||||
<xsd:enumeration value="service" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:complexType name="mailer">
|
||||
<xsd:attribute name="html-to-text-converter" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
||||
@@ -15,9 +15,11 @@ use Psr\Container\ContainerInterface;
|
||||
use Symfony\Bridge\Twig\AppVariable;
|
||||
use Symfony\Bridge\Twig\DataCollector\TwigDataCollector;
|
||||
use Symfony\Bridge\Twig\ErrorRenderer\TwigErrorRenderer;
|
||||
use Symfony\Bridge\Twig\EventListener\TemplateAttributeListener;
|
||||
use Symfony\Bridge\Twig\Extension\AssetExtension;
|
||||
use Symfony\Bridge\Twig\Extension\CodeExtension;
|
||||
use Symfony\Bridge\Twig\Extension\ExpressionExtension;
|
||||
use Symfony\Bridge\Twig\Extension\HtmlSanitizerExtension;
|
||||
use Symfony\Bridge\Twig\Extension\HttpFoundationExtension;
|
||||
use Symfony\Bridge\Twig\Extension\HttpKernelExtension;
|
||||
use Symfony\Bridge\Twig\Extension\HttpKernelRuntime;
|
||||
@@ -52,7 +54,6 @@ use Twig\TemplateWrapper;
|
||||
return static function (ContainerConfigurator $container) {
|
||||
$container->services()
|
||||
->set('twig', Environment::class)
|
||||
->public()
|
||||
->args([service('twig.loader'), abstract_arg('Twig options')])
|
||||
->call('addGlobal', ['app', service('twig.app_variable')])
|
||||
->call('addRuntimeLoader', [service('twig.runtime_loader')])
|
||||
@@ -65,9 +66,9 @@ return static function (ContainerConfigurator $container) {
|
||||
->tag('container.preload', ['class' => ExtensionSet::class])
|
||||
->tag('container.preload', ['class' => Template::class])
|
||||
->tag('container.preload', ['class' => TemplateWrapper::class])
|
||||
->tag('container.private', ['package' => 'symfony/twig-bundle', 'version' => '5.2'])
|
||||
|
||||
->alias('Twig_Environment', 'twig')
|
||||
->deprecate('symfony/twig-bundle', '6.3', 'The "%alias_id%" service alias is deprecated, use "'.Environment::class.'" or "twig" instead.')
|
||||
->alias(Environment::class, 'twig')
|
||||
|
||||
->set('twig.app_variable', AppVariable::class)
|
||||
@@ -75,9 +76,11 @@ return static function (ContainerConfigurator $container) {
|
||||
->call('setDebug', [param('kernel.debug')])
|
||||
->call('setTokenStorage', [service('security.token_storage')->ignoreOnInvalid()])
|
||||
->call('setRequestStack', [service('request_stack')->ignoreOnInvalid()])
|
||||
->call('setLocaleSwitcher', [service('translation.locale_switcher')->ignoreOnInvalid()])
|
||||
->call('setEnabledLocales', [param('kernel.enabled_locales')])
|
||||
|
||||
->set('twig.template_iterator', TemplateIterator::class)
|
||||
->args([service('kernel'), abstract_arg('Twig paths'), param('twig.default_path')])
|
||||
->args([service('kernel'), abstract_arg('Twig paths'), param('twig.default_path'), abstract_arg('File name pattern')])
|
||||
|
||||
->set('twig.template_cache_warmer', TemplateCacheWarmer::class)
|
||||
->args([service(ContainerInterface::class), service('twig.template_iterator')])
|
||||
@@ -120,6 +123,9 @@ return static function (ContainerConfigurator $container) {
|
||||
|
||||
->set('twig.extension.expression', ExpressionExtension::class)
|
||||
|
||||
->set('twig.extension.htmlsanitizer', HtmlSanitizerExtension::class)
|
||||
->args([tagged_locator('html_sanitizer', 'sanitizer')])
|
||||
|
||||
->set('twig.extension.httpkernel', HttpKernelExtension::class)
|
||||
|
||||
->set('twig.runtime.httpkernel', HttpKernelRuntime::class)
|
||||
@@ -167,5 +173,9 @@ return static function (ContainerConfigurator $container) {
|
||||
->args([service('serializer')])
|
||||
|
||||
->set('twig.extension.serializer', SerializerExtension::class)
|
||||
|
||||
->set('controller.template_attribute_listener', TemplateAttributeListener::class)
|
||||
->args([service('twig')])
|
||||
->tag('kernel.event_subscriber')
|
||||
;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user