Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Deprecate setting the collect_serializer_data to false #60069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions UPGRADE-7.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ FrameworkBundle
because its default value will change in version 8.0
* Deprecate the `--show-arguments` option of the `container:debug` command, as arguments are now always shown
* Deprecate the `framework.validation.cache` config option
* Deprecate setting the `framework.profiler.collect_serializer_data` config option to `false`

When set to `true`, normalizers must be injected using the `NormalizerInterface`, and not using any concrete implementation.

Before:

```php
public function __construct(ObjectNormalizer $normalizer) {}
```

After:

```php
public function __construct(#[Autowire('@serializer.normalizer.object')] NormalizerInterface $normalizer) {}
```

Ldap
----
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CHANGELOG
* Allow configuring the logging channel per type of exceptions
* Enable service argument resolution on classes that use the `#[Route]` attribute,
the `#[AsController]` attribute is no longer required
* Deprecate setting the `framework.profiler.collect_serializer_data` config option to `false`

7.2
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
$loader->load('notifier_debug.php');
}

if (false === $config['collect_serializer_data']) {
trigger_deprecation('symfony/framework-bundle', '7.3', 'Setting the "framework.profiler.collect_serializer_data" config option to "false" is deprecated.');
}

if ($this->isInitializedConfigEnabled('serializer') && $config['collect_serializer_data']) {
$loader->load('serializer_debug.php');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
'php_errors' => ['log' => true],
'profiler' => [
'enabled' => true,
'collect_serializer_data' => true,
],
'serializer' => [
'enabled' => true,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<framework:config http-method-override="false" handle-all-throwables="true">
<framework:annotations enabled="false" />
<framework:php-errors log="true" />
<framework:profiler enabled="true" />
<framework:profiler enabled="true" collect-serializer-data="true" />
<framework:serializer enabled="true" />
</framework:config>
</container>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ framework:
log: true
profiler:
enabled: true
collect_serializer_data: true
serializer:
enabled: true

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,13 @@ public function testDisabledProfiler()

public function testProfilerCollectSerializerDataEnabled()
{
$container = $this->createContainerFromFile('profiler_collect_serializer_data');
$container = $this->createContainerFromFile('profiler');

$this->assertTrue($container->hasDefinition('profiler'));
$this->assertTrue($container->hasDefinition('serializer.data_collector'));
$this->assertTrue($container->hasDefinition('debug.serializer'));
}

public function testProfilerCollectSerializerDataDefaultDisabled()
{
$container = $this->createContainerFromFile('profiler');

$this->assertTrue($container->hasDefinition('profiler'));
$this->assertFalse($container->hasDefinition('serializer.data_collector'));
$this->assertFalse($container->hasDefinition('debug.serializer'));
}

public function testWorkflows()
{
$container = $this->createContainerFromFile('workflows');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ framework:
cookie_samesite: lax
php_errors:
log: true
profiler:
collect_serializer_data: true

services:
logger: { class: Psr\Log\NullLogger }
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ framework:
cookie_samesite: lax
php_errors:
log: true
profiler: { only_exceptions: false }
profiler:
only_exceptions: false
collect_serializer_data: true

services:
logger: { class: Psr\Log\NullLogger }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ framework:
cookie_samesite: lax
php_errors:
log: true
profiler: { only_exceptions: false }
profiler:
only_exceptions: false
collect_serializer_data: true

services:
logger: { class: Psr\Log\NullLogger }
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
'http_method_override' => false,
'php_errors' => ['log' => true],
'secret' => 'foo-secret',
'profiler' => ['only_exceptions' => false],
'profiler' => ['only_exceptions' => false, 'collect_serializer_data' => true],
'session' => ['handler_id' => null, 'storage_factory_id' => 'session.storage.factory.mock_file', 'cookie-secure' => 'auto', 'cookie-samesite' => 'lax'],
'router' => ['utf8' => true],
];
Expand Down
Loading