Skip to content

Commit 49f4a86

Browse files
[FrameworkBundle] Improve deprecation for handler_id/save_path config options
1 parent f01ba2e commit 49f4a86

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ CHANGELOG
1717
* Deprecate not setting the `framework.php_errors.log` config option; it will default to `true` in 7.0
1818
* Deprecate not setting the `framework.session.cookie_secure` config option; it will default to `auto` in 7.0
1919
* Deprecate not setting the `framework.session.cookie_samesite` config option; it will default to `lax` in 7.0
20-
* Deprecate not setting the `framework.session.handler_id` config option; it will default to `session.handler.native_file` when `framework.session.save_path` is set or `null` otherwise in 7.0
21-
* Deprecate not setting the `framework.session.save_path` config option when `framework.session.handler_id` is not set; it will default to `null` in 7.0
20+
* Deprecate not setting either `framework.session.handler_id` or `save_path` config options; `handler_id` will
21+
default to null in 7.0 if `save_path` is not set and to `session.handler.native_file` otherwise
22+
* Deprecate not setting the `framework.session.handler_id` config option; it will default to null,
23+
unless `save_path` is set, which will make it default to `session.handler.native_file` in 7.0
2224
* Deprecate not setting the `framework.uid.default_uuid_version` config option; it will default to `7` in 7.0
2325
* Deprecate not setting the `framework.uid.time_based_uuid_version` config option; it will default to `7` in 7.0
2426
* Deprecate not setting the `framework.validation.email_validation_mode` config option; it will default to `html5` in 7.0

DependencyInjection/Configuration.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,8 @@ private function addSessionSection(ArrayNodeDefinition $rootNode): void
669669
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "framework.session.cookie_samesite" config option is deprecated. It will default to "lax" in 7.0.');
670670
}
671671

672-
if (!\array_key_exists('handler_id', $v['session'])) {
673-
if (!\array_key_exists('save_path', $v['session'])) {
674-
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "framework.session.save_path" config option when the "framework.session.handler_id" config option is not set either is deprecated. Both options will default to "null" in 7.0.');
675-
} else {
676-
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "framework.session.handler_id" config option is deprecated. It will default to "session.handler.native_file" when "framework.session.save_path" is set or "null" otherwise in 7.0.');
677-
}
672+
if (!\array_key_exists('handler_id', $v['session']) && !\array_key_exists('handler_id', $v['save_path'])) {
673+
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting either "framework.session.handler_id" or "save_path" config options is deprecated; "handler_id" will default to null in 7.0 if "save_path" is not set and to "session.handler.native_file" otherwise.');
678674
}
679675
}
680676

0 commit comments

Comments
 (0)