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 408d09a

Browse filesBrowse files
committed
[FrameworkBundle] Deprecate setting the collect_serializer_data to false
1 parent 561d4a0 commit 408d09a
Copy full SHA for 408d09a

File tree

Expand file treeCollapse file tree

14 files changed

+33
-55
lines changed
Filter options
Expand file treeCollapse file tree

14 files changed

+33
-55
lines changed

‎UPGRADE-7.3.md

Copy file name to clipboardExpand all lines: UPGRADE-7.3.md
+15Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
+1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
988988
$loader->load('notifier_debug.php');
989989
}
990990

991+
if (false === $config['collect_serializer_data']) {
992+
trigger_deprecation('symfony/framework-bundle', '7.3', 'Setting the "framework.profiler.collect_serializer_data" config option to "false" is deprecated.');
993+
}
994+
991995
if ($this->isInitializedConfigEnabled('serializer') && $config['collect_serializer_data']) {
992996
$loader->load('serializer_debug.php');
993997
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler.php
+1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler_collect_serializer_data.php
-15Lines changed: 0 additions & 15 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/profiler.xml
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/profiler_collect_serializer_data.xml
-15Lines changed: 0 additions & 15 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/profiler.yml
+1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/profiler_collect_serializer_data.yml
-11Lines changed: 0 additions & 11 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php
+1-10Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml
+2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/config.yml
+3-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/framework.yml
+3-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.