Skip to content

Commit 8b29d0d

Browse files
committed
[FrameworkBundle] deprecate not setting http_method_overwrite to be able to change the default in 7.0
1 parent 1f514f9 commit 8b29d0d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,23 @@ public function getConfigTreeBuilder(): TreeBuilder
7474
return $v;
7575
})
7676
->end()
77+
->validate()
78+
->always(function ($v) {
79+
if (!isset($v['http_method_override'])) {
80+
trigger_deprecation('symfony/framework-bundle', '6.1', 'Not setting the "framework.http_method_override" config option is deprecated. It will default to "false" in 7.0.');
81+
82+
$v['http_method_override'] = true;
83+
}
84+
85+
return $v;
86+
})
87+
->end()
7788
->fixXmlConfig('enabled_locale')
7889
->children()
7990
->scalarNode('secret')->end()
80-
->scalarNode('http_method_override')
91+
->booleanNode('http_method_override')
8192
->info("Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. Note: When using the HttpCache, you need to call the method in your front controller instead")
82-
->defaultTrue()
93+
->treatNullLike(false)
8394
->end()
8495
->scalarNode('ide')->defaultValue('%env(default::SYMFONY_IDE)%')->end()
8596
->booleanNode('test')->end()

0 commit comments

Comments
 (0)