From 79cbf005dac81cab78fff2907a3b0ae14a122eb4 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Mon, 19 Apr 2021 18:33:12 +0200 Subject: [PATCH] [FrameworkBundle] Deprecate creating public workflow services --- UPGRADE-5.3.md | 1 + UPGRADE-6.0.md | 1 + src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 1 + .../DependencyInjection/FrameworkExtension.php | 4 ++++ .../Bundle/FrameworkBundle/Resources/config/workflow.php | 2 ++ 5 files changed, 9 insertions(+) diff --git a/UPGRADE-5.3.md b/UPGRADE-5.3.md index c19356ef43..be36db0c14 100644 --- a/UPGRADE-5.3.md +++ b/UPGRADE-5.3.md @@ -43,6 +43,7 @@ FrameworkBundle * Deprecate the `session` service and the `SessionInterface` alias, use the `\Symfony\Component\HttpFoundation\Request::getSession()` or the new `\Symfony\Component\HttpFoundation\RequestStack::getSession()` methods instead * Deprecate the `KernelTestCase::$container` property, use `KernelTestCase::getContainer()` instead * Rename the container parameter `profiler_listener.only_master_requests` to `profiler_listener.only_main_requests` + * Deprecate registering workflow services as public HttpFoundation -------------- diff --git a/UPGRADE-6.0.md b/UPGRADE-6.0.md index 0858971022..68f1bf9419 100644 --- a/UPGRADE-6.0.md +++ b/UPGRADE-6.0.md @@ -85,6 +85,7 @@ FrameworkBundle `cache_clearer`, `filesystem` and `validator` services are now private. * Removed the `lock.RESOURCE_NAME` and `lock.RESOURCE_NAME.store` services and the `lock`, `LockInterface`, `lock.store` and `PersistingStoreInterface` aliases, use `lock.RESOURCE_NAME.factory`, `lock.factory` or `LockFactory` instead. * Remove the `KernelTestCase::$container` property, use `KernelTestCase::getContainer()` instead + * Registered workflow services are now private HttpFoundation -------------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index d9d62d47af..d2ce954777 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -19,6 +19,7 @@ CHANGELOG * Add `KernelTestCase::getContainer()` as the best way to get a container in tests * Rename the container parameter `profiler_listener.only_master_requests` to `profiler_listener.only_main_requests` * Add service `fragment.uri_generator` to generate the URI of a fragment + * Deprecate registering workflow services as public 5.2.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index cdae88df62..7e37224962 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -863,6 +863,10 @@ class FrameworkExtension extends Extension $workflowDefinition->replaceArgument(1, $markingStoreDefinition ?? null); $workflowDefinition->replaceArgument(3, $name); $workflowDefinition->replaceArgument(4, $workflow['events_to_dispatch']); + $workflowDefinition->addTag('container.private', [ + 'package' => 'symfony/framework-bundle', + 'version' => '5.3', + ]); // Store to container $container->setDefinition($workflowId, $workflowDefinition); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.php index 6eae2b16c4..909bb5acab 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.php @@ -29,6 +29,7 @@ return static function (ContainerConfigurator $container) { ]) ->abstract() ->public() + ->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.3']) ->set('state_machine.abstract', StateMachine::class) ->args([ abstract_arg('workflow definition'), @@ -39,6 +40,7 @@ return static function (ContainerConfigurator $container) { ]) ->abstract() ->public() + ->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.3']) ->set('workflow.marking_store.method', MethodMarkingStore::class) ->abstract() ->set('workflow.registry', Registry::class)