Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32941f2

Browse filesBrowse files
committed
feature #36691 [FrameworkBundle] Deprecate some public services to private (fancyweb)
This PR was merged into the 5.2-dev branch. Discussion ---------- [FrameworkBundle] Deprecate some public services to private | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - Now that we can deprecate public services to private, here is a first pass on the FWB. I think all those services don't need to be public, ie we never need to access them directly in Symfony's code (except in some tests that I had to modify accordingly). I think most of theses services needed to be public before we hooked the AbstractController with a service subscriber. There are definitely more of them that can be deprecated (ie: created workflows and state machines are public but don't need to be ?) but let's start with the easy ones. Commits ------- 87868ba [FrameworkBundle] Deprecate some public services to private
2 parents 5256323 + 87868ba commit 32941f2
Copy full SHA for 32941f2

File tree

Expand file treeCollapse file tree

19 files changed

+56
-6
lines changed
Filter options
Expand file treeCollapse file tree

19 files changed

+56
-6
lines changed

‎UPGRADE-5.2.md

Copy file name to clipboardExpand all lines: UPGRADE-5.2.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ DependencyInjection
66

77
* Deprecated `Definition::setPrivate()` and `Alias::setPrivate()`, use `setPublic()` instead
88

9+
FrameworkBundle
10+
---------------
11+
12+
* Deprecated the public `form.factory`, `form.type.file`, `translator`, `security.csrf.token_manager`, `serializer`,
13+
`cache_clearer`, `filesystem` and `validator` services to private.
14+
915
Mime
1016
----
1117

‎UPGRADE-6.0.md

Copy file name to clipboardExpand all lines: UPGRADE-6.0.md
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ FrameworkBundle
5555
* `MicroKernelTrait::configureRoutes()` is now always called with a `RoutingConfigurator`
5656
* The "framework.router.utf8" configuration option defaults to `true`
5757
* Removed `session.attribute_bag` service and `session.flash_bag` service.
58+
* The `form.factory`, `form.type.file`, `translator`, `security.csrf.token_manager`, `serializer`,
59+
`cache_clearer`, `filesystem` and `validator` services are now private.
5860

5961
HttpFoundation
6062
--------------

‎src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ CHANGELOG
66

77
* Added `framework.http_cache` configuration tree
88
* Added `framework.trusted_proxies` and `framework.trusted_headers` configuration options
9+
* Deprecated the public `form.factory`, `form.type.file`, `translator`, `security.csrf.token_manager`, `serializer`,
10+
`cache_clearer`, `filesystem` and `validator` services to private.
911

1012
5.1.0
1113
-----

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/form.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/form.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
->set('form.factory', FormFactory::class)
6262
->public()
6363
->args([service('form.registry')])
64+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
6465

6566
->alias(FormFactoryInterface::class, 'form.factory')
6667

@@ -103,6 +104,7 @@
103104
->public()
104105
->args([service('translator')->ignoreOnInvalid()])
105106
->tag('form.type')
107+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
106108

107109
->set('form.type.color', ColorType::class)
108110
->args([service('translator')->ignoreOnInvalid()])

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/identity_translator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/identity_translator.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
$container->services()
1919
->set('translator', IdentityTranslator::class)
2020
->public()
21+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
2122
->alias(TranslatorInterface::class, 'translator')
2223

2324
->set('identity_translator', IdentityTranslator::class)

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/security_csrf.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/security_csrf.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
service('security.csrf.token_storage'),
3939
service('request_stack')->ignoreOnInvalid(),
4040
])
41+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
4142

4243
->alias(CsrfTokenManagerInterface::class, 'security.csrf.token_manager')
4344

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
->set('serializer', Serializer::class)
5656
->public()
5757
->args([[], []])
58+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
5859

5960
->alias(SerializerInterface::class, 'serializer')
6061
->alias(NormalizerInterface::class, 'serializer')

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/services.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/services.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class_exists(WorkflowEvents::class) ? WorkflowEvents::ALIASES : []
118118
->args([
119119
tagged_iterator('kernel.cache_clearer'),
120120
])
121+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
121122

122123
->set('kernel')
123124
->synthetic()
@@ -126,6 +127,7 @@ class_exists(WorkflowEvents::class) ? WorkflowEvents::ALIASES : []
126127

127128
->set('filesystem', Filesystem::class)
128129
->public()
130+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
129131
->alias(Filesystem::class, 'filesystem')
130132

131133
->set('file_locator', FileLocator::class)

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
->set('validator', ValidatorInterface::class)
3131
->public()
3232
->factory([service('validator.builder'), 'getValidator'])
33+
->tag('container.private', ['package' => 'symfony/framework-bundle', 'version' => '5.2'])
3334
->alias(ValidatorInterface::class, 'validator')
3435

3536
->set('validator.builder', ValidatorBuilder::class)

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
'enable_annotations' => true,
88
],
99
]);
10+
11+
$container->setAlias('validator.alias', 'validator')->setPublic(true);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.