8000 [FrameworkBundle] Move identity translator configuration to PHP · flack/symfony@335c9db · GitHub
[go: up one dir, main page]

Skip to content

Commit 335c9db

Browse files
author
Sagrario Meneses
committed
[FrameworkBundle] Move identity translator configuration to PHP
1 parent 3c5f9d1 commit 335c9db

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function load(array $configs, ContainerBuilder $container)
213213
}
214214

215215
if (class_exists(Translator::class)) {
216-
$loader->load('identity_translator.xml');
216+
$phpLoader->load('identity_translator.php');
217217
}
218218
}
219219

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
13+
14+
use Symfony\Component\Translation\IdentityTranslator;
15+
use Symfony\Contracts\Translation\TranslatorInterface;
16+
17+
return static function (ContainerConfigurator $container) {
18+
$container->services()
19+
->set('translator', IdentityTranslator::class)
20+
->public()
21+
->alias(TranslatorInterface::class, 'translator')
22+
23+
->set('identity_translator', IdentityTranslator::class)
24+
;
25+
};

src/Symfony/Bundle/FrameworkBundle/Resources/config/identity_translator.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0