8000 feature #60069 [FrameworkBundle] Deprecate setting the `collect_seria… · symfony/symfony@58a14ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 58a14ab

Browse files
feature #60069 [FrameworkBundle] Deprecate setting the collect_serializer_data to false (mtarld)
This PR was merged into the 7.3 branch. Discussion ---------- [FrameworkBundle] Deprecate setting the `collect_serializer_data` to `false` | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | yes | Issues | | License | MIT Then, in 8.1, we'll be able to deprecate this option to finally remove it in 9.0 Commits ------- 408d09a [FrameworkBundle] Deprecate setting the `collect_serializer_data` to `false`
2 parents 85e922a + 408d09a commit 58a14ab

File tree

14 files changed

+33
-55
lines changed

14 files changed

+33
-55
lines changed

UPGRADE-7.3.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ FrameworkBundle
5858
because its default value will change in version 8.0
5959
* Deprecate the `--show-arguments` option of the `container:debug` command, as arguments are now always shown
6060
* Deprecate the `framework.validation.cache` config option
61+
* Deprecate setting the `framework.profiler.collect_serializer_data` config option to `false`
62+
63+
When set to `true`, normalizers must be injected using the `NormalizerInterface`, and not using any concrete implementation.
64+
65+
Before:
66+
67+
```php
68+
public function __construct(ObjectNormalizer $normalizer) {}
69+
```
70+
71+
After:
72+
73+
```php
74+
public function __construct(#[Autowire('@serializer.normalizer.object')] NormalizerInterface $normalizer) {}
75+
```
6176

6277
Ldap
6378
----

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CHANGELOG
2121
* Allow configuring the logging channel per type of exceptions
2222
* Enable service argument resolution on classes that use the `#[Route]` attribute,
2323
the `#[AsController]` attribute is no longer required
24+
* Deprecate setting the `framework.profiler.collect_serializer_data` config option to `false`
2425

2526
7.2
2627
---

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
994994
$loader->load('notifier_debug.php');
995995
}
996996

997+
if (false === $config['collect_serializer_data']) {
998+
trigger_deprecation('symfony/framework-bundle', '7.3', 'Setting the "framework.profiler.collect_serializer_data" config option to "false" is deprecated.');
999+
}
1000+
9971001
if ($this->isInitializedConfigEnabled('serializer') && $config['collect_serializer_data']) {
9981002
$loader->load('serializer_debug.php');
9991003
}

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'php_errors' => ['log' => true],
88
'profiler' => [
99
'enabled' => true,
10+
'collect_serializer_data' => true,
1011
],
1112
'serializer' => [
1213
'enabled' => true,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler_collect_serializer_data.php

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

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/profiler.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<framework:config http-method-override="false" handle-all-throwables="true">
1010
<framework:annotations enabled="false" />
1111
<framework:php-errors log="true" />
12-
<framework:profiler enabled="true" />
12+
<framework:profiler enabled="true" collect-serializer-data="true" />
1313
<framework:serializer enabled="true" />
1414
</framework:config>
1515
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/profiler_collect_serializer_data.xml

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

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/profiler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ framework:
66
log: true
77
profiler:
88
enabled: true
9+
collect_serializer_data: true
910
serializer:
1011
enabled: true

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/profiler_collect_serializer_data.yml

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

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,22 +278,13 @@ public function testDisabledProfiler()
278278

279279
public function testProfilerCollectSerializerDataEnabled()
280280
{
281-
$container = $this->createContainerFromFile('profiler_collect_serializer_data');
281+
$container = $this->createContainerFromFile('profiler');
282282

283283
$this->assertTrue($container->hasDefinition('profiler'));
284284
$this->assertTrue($container->hasDefinition('serializer.data_collector'));
285285
$this->assertTrue($container->hasDefinition('debug.serializer'));
286286
}
287287

288-
public function testProfilerCollectSerializerDataDefaultDisabled()
289-
{
290-
$container = $this->createContainerFromFile('profiler');
291-
292-
$this->assertTrue($container->hasDefinition('profiler'));
293-
$this->assertFalse($container->hasDefinition('serializer.data_collector'));
294-
$this->assertFalse($container->hasDefinition('debug.serializer'));
295-
}
296-
297288
public function testWorkflows()
298289
{
299290
$container = $this->createContainerFromFile('workflows');

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ framework:
1818
cookie_samesite: lax
1919
php_errors:
2020
log: true
21+
profiler:
22+
collect_serializer_data: true
2123

2224
services:
2325
logger: { class: Psr\Log\NullLogger }

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ framework:
1717
cookie_samesite: lax
1818
php_errors:
1919
log: true
20-
profiler: { only_exceptions: false }
20+
profiler:
21+
only_exceptions: false
22+
collect_serializer_data: true
2123

2224
services:
2325
logger: { class: Psr\Log\NullLogger }

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/framework.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ framework:
1818
cookie_samesite: lax
1919
php_errors:
2020
log: true
21-
profiler: { only_exceptions: false }
21+
profiler:
22+
only_exceptions: false
23+
collect_serializer_data: true
2224

2325
services:
2426
logger: { class: Psr\Log\NullLogger }

src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
5555
'http_method_override' => false,
5656
'php_errors' => ['log' => true],
5757
'secret' => 'foo-secret',
58-
'profiler' => ['only_exceptions' => false],
58+
'profiler' => ['only_exceptions' => false, 'collect_serializer_data' => true],
5959
'session' => ['handler_id' => null, 'storage_factory_id' => 'session.storage.factory.mock_file', 'cookie-secure' => 'auto', 'cookie-samesite' => 'lax'],
6060
'router' => ['utf8' => true],
6161
];

0 commit comments

Comments
 (0)
0