Skip to content

Commit f140466

Browse files
committed
[FrameworkBundle][Routing][Translation][Workflow] Move some compiler passes from FrameworkBundle to components
1 parent 760a80c commit f140466

11 files changed

+41
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ CHANGELOG
3838
* Deprecate the `routing.loader.annotation.directory` service, use the `routing.loader.attribute.directory` service instead
3939
* Deprecate the `routing.loader.annotation.file` service, use the `routing.loader.attribute.file` service instead
4040
* Deprecate `AnnotatedRouteControllerLoader`, use `AttributeRouteControllerLoader` instead
41+
* Deprecate `AddExpressionLanguageProvidersPass`, use `Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass` instead
42+
* Deprecate `DataCollectorTranslatorPass`, use `Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass` instead
43+
* Deprecate `LoggingTranslatorPass`, use `Symfony\Component\Translation\DependencyInjection\LoggingTranslatorPass` instead
44+
* Deprecate `WorkflowGuardListenerPass`, use `Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass` instead
4145

4246
6.3
4347
---

DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Reference;
1717

18+
trigger_deprecation('symfony/framework-bundle', '6.4', 'The "%s" class is deprecated, use "%s" instead.', AddExpressionLanguageProvidersPass::class, \Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass::class);
19+
1820
/**
1921
* Registers the expression language providers.
2022
*
2123
* @author Fabien Potencier <fabien@symfony.com>
24+
*
25+
* @deprecated since Symfony 6.4, use Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass instead.
2226
*/
2327
class AddExpressionLanguageProvidersPass implements CompilerPassInterface
2428
{

DependencyInjection/Compiler/DataCollectorTranslatorPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\Translation\TranslatorBagInterface;
1717

18+
trigger_deprecation('symfony/framework-bundle', '6.4', 'The "%s" class is deprecated, use "%s" instead.', DataCollectorTranslatorPass::class, \Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass::class);
19+
1820
/**
1921
* @author Christian Flothmann <christian.flothmann@sensiolabs.de>
22+
*
23+
* @deprecated since Symfony 6.4, use Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass instead.
2024
*/
2125
class DataCollectorTranslatorPass implements CompilerPassInterface
2226
{

DependencyInjection/Compiler/LoggingTranslatorPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
use Symfony\Component\Translation\TranslatorBagInterface;
1818
use Symfony\Contracts\Translation\TranslatorInterface;
1919

20+
trigger_deprecation('symfony/framework-bundle', '6.4', 'The "%s" class is deprecated, use "%s" instead.', LoggingTranslatorPass::class, \Symfony\Component\Translation\DependencyInjection\LoggingTranslatorPass::class);
21+
2022
/**
2123
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
24+
*
25+
* @deprecated since Symfony 6.4, use Symfony\Component\Translation\DependencyInjection\LoggingTranslatorPass instead.
2226
*/
2327
class LoggingTranslatorPass implements CompilerPassInterface
2428
{

DependencyInjection/Compiler/WorkflowGuardListenerPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Exception\LogicException;
1717

18+
trigger_deprecation('symfony/framework-bundle', '6.4', 'The "%s" class is deprecated, use "%s" instead.', WorkflowGuardListenerPass::class, \Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass::class);
19+
1820
/**
1921
* @author Christian Flothmann <christian.flothmann@sensiolabs.de>
2022
* @author Grégoire Pineau <lyrixx@lyrixx.info>
23+
*
24+
* @deprecated since Symfony 6.4, use Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass instead.
2125
*/
2226
class WorkflowGuardListenerPass implements CompilerPassInterface
2327
{

FrameworkBundle.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddAnnotationsCachedReaderPass;
1515
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddDebugLogProcessorPass;
16-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddExpressionLanguageProvidersPass;
1716
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AssetsContextPass;
1817
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ContainerBuilderDebugDumpPass;
19-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\DataCollectorTranslatorPass;
2018
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ErrorLoggerCompilerPass;
21-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\LoggingTranslatorPass;
2219
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ProfilerPass;
2320
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RemoveUnusedSessionMarshallingHandlerPass;
2421
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TestServiceContainerRealRefPass;
2522
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TestServiceContainerWeakRefPass;
2623
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\UnusedTagsPass;
27-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\WorkflowGuardListenerPass;
2824
use Symfony\Component\Cache\Adapter\ApcuAdapter;
2925
use Symfony\Component\Cache\Adapter\ArrayAdapter;
3026
use Symfony\Component\Cache\Adapter\ChainAdapter;
@@ -59,9 +55,12 @@
5955
use Symfony\Component\Messenger\DependencyInjection\MessengerPass;
6056
use Symfony\Component\Mime\DependencyInjection\AddMimeTypeGuesserPass;
6157
use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass;
58+
use Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass;
6259
use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass;
6360
use Symfony\Component\Scheduler\DependencyInjection\AddScheduleMessengerPass;
6461
use Symfony\Component\Serializer\DependencyInjection\SerializerPass;
62+
use Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass;
63+
use Symfony\Component\Translation\DependencyInjection\LoggingTranslatorPass;
6564
use Symfony\Component\Translation\DependencyInjection\TranslationDumperPass;
6665
use Symfony\Component\Translation\DependencyInjection\TranslationExtractorPass;
6766
use Symfony\Component\Translation\DependencyInjection\TranslatorPass;
@@ -71,6 +70,7 @@
7170
use Symfony\Component\Validator\DependencyInjection\AddValidatorInitializersPass;
7271
use Symfony\Component\VarExporter\Internal\Hydrator;
7372
use Symfony\Component\VarExporter\Internal\Registry;
73+
use Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass;
7474

7575
// Help opcache.preload discover always-needed symbols
7676
class_exists(ApcuAdapter::class);
@@ -157,7 +157,7 @@ public function build(ContainerBuilder $container)
157157
$this->addCompilerPassIfExists($container, TranslatorPass::class, PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
158158
$this->addCompilerPassIfExists($container, TranslatorPathsPass::class, PassConfig::TYPE_AFTER_REMOVING);
159159
$container->addCompilerPass(new LoggingTranslatorPass());
160-
$container->addCompilerPass(new AddExpressionLanguageProvidersPass(false));
160+
$container->addCompilerPass(new AddExpressionLanguageProvidersPass());
161161
$this->addCompilerPassIfExists($container, TranslationExtractorPass::class);
162162
$this->addCompilerPassIfExists($container, TranslationDumperPass::class);
163163
$container->addCompilerPass(new FragmentRendererPass());

Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Symfony\Component\DependencyInjection\Definition;
1818
use Symfony\Component\DependencyInjection\Reference;
1919

20+
/**
21+
* @group legacy
22+
*/
2023
class AddExpressionLanguageProvidersPassTest extends TestCase
2124
{
2225
public function testProcessForRouter()

Tests/DependencyInjection/Compiler/DataCollectorTranslatorPassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
use Symfony\Component\Translation\Translator;
2121
use Symfony\Contracts\Translation\TranslatorInterface;
2222

23+
/**
24+
* @group legacy
25+
*/
2326
class DataCollectorTranslatorPassTest extends TestCase
2427
{
2528
private ContainerBuilder $container;

Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Symfony\Component\DependencyInjection\Reference;
1818
use Symfony\Component\Translation\Translator;
1919

20+
/**
21+
* @group legacy
22+
*/
2023
class LoggingTranslatorPassTest extends TestCase
2124
{
2225
public function testProcess()

Tests/DependencyInjection/Compiler/WorkflowGuardListenerPassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
use Symfony\Component\Security\Core\Role\RoleHierarchy;
2222
use Symfony\Component\Validator\Validator\ValidatorInterface;
2323

24+
/**
25+
* @group legacy
26+
*/
2427
class WorkflowGuardListenerPassTest extends TestCase
2528
{
2629
private ContainerBuilder $container;

0 commit comments

Comments
 (0)