8000 Add deprecation · symfony/symfony@f50586a · GitHub
[go: up one dir, main page]

Skip to content

Commit f50586a

Browse files
committed
Add deprecation
1 parent f764050 commit f50586a

File tree

14 files changed

+38
-13
lines changed

14 files changed

+38
-13
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,11 +1230,20 @@ private function addPropertyInfoSection(ArrayNodeDefinition $rootNode, callable
12301230
->children()
12311231
->booleanNode('with_constructor_extractor')
12321232
->info('Registers the constructor extractor.')
1233-
->defaultFalse()
12341233
->end()
12351234
->end()
12361235
->end()
12371236
->end()
1237+
->validate()
1238+
->ifTrue(fn ($v) => $v['property_info']['enabled'] && !isset($v['property_info']['with_constructor_extractor']))
1239+
->then(function ($v) {
1240+
$v['property_info']['with_constructor_extractor'] = false;
1241+
1242+
trigger_deprecation('symfony/property-info', '7.3', 'Not setting the "with_constructor_extractor" option explicitly is deprecated because its default value will change in version 8.0.');
1243+
1244+
return $v;
1245+
})
1246+
->end()
12381247
;
12391248
}
12401249

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,7 @@ protected static function getBundleDefaultConfig()
808808
],
809809
'property_info' => [
810810
'enabled' => !class_exists(FullStack::class),
811-
'with_constructor_extractor' => false,
812-
],
811+
] + (!class_exists(FullStack::class) ? ['with_constructor_extractor' => false] : []),
813812
'router' => [
814813
'enabled' => false,
815814
'default_uri' => null,

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474
],
7575
],
7676
],
77-
'property_info' => true,
77+
'property_info' => [
78+
'enabled' => true,
79+
'with_constructor_extractor' => true,
80+
],
7881
'type_info' => true,
7982
'ide' => 'file%%link%%format',
8083
'request' => [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
'php_errors' => ['log' => true],
88
'property_info' => [
99
'enabled' => true,
10+
'with_constructor_extractor' => false,
1011
],
1112
]);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
'http_method_override' => false,
66
'handle_all_throwables' => true,
77
'php_errors' => ['log' => true],
8-
'property_info' => ['enabled' => true],
8+
'property_info' => [
9+
'enabled' => true,
10+
'with_constructor_extractor' => true,
11+
],
912
'validation' => [
1013
'email_validation_mode' => 'html5',
1114
'auto_mapping' => [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</framework:default-context>
4545
</framework:named-serializer>
4646
</framework:serializer>
47-
<framework:property-info />
47+
<framework:property-info with-constructor-extractor="true" />
4848
<framework:type-info />
4949
<framework:json-encoder />
5050
</framework:config>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<framework:config http-method-override="false" handle-all-throwables="true">
99
<framework:annotations enabled="false" />
1010
<framework:php-errors log="true" />
11-
<framework:property-info enabled="true" />
11+
<framework:property-info enabled="true" with-constructor-extractor="false" />
1212
</framework:config>
1313
</container>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<framework:config http-method-override="false" handle-all-throwables="true">
77
<framework:annotations enabled="false" />
88
<framework:php-errors log="true" />
9-
<framework:property-info enabled="true" />
9+
<framework:property-info enabled="true" with-constructor-extractor="true" />
1010
<framework:validation email-validation-mode="html5">
1111
<framework:auto-mapping namespace="App\">
1212
<framework:service>foo</framework:service>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ framework:
6464
default_context:
6565
enable_max_depth: false
6666
type_info: ~
67-
property_info: ~
67+
property_info:
68+
with_constructor_extractor: true
6869
ide: file%%link%%format
6970
request:
7071
formats:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ framework:
66
log: true
77
property_info:
88
enabled: true
9+
with_constructor_extractor: false

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ framework:
44
handle_all_throwables: true
55
php_errors:
66
log: true
7-
property_info: { enabled: true }
7+
property_info:
8+
enabled: true
9+
with_constructor_extractor: true
810
validation:
911
email_validation_mode: html5
1012
auto_mapping:

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ framework:
55
serializer:
66
enabled: true
77
validation: true
8-
property_info: { enabled: true }
8+
property_info:
9+
enabled: true
10+
with_constructor_extractor: true

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ framework:
1515
translator: true
1616
validation: true
1717
serializer: true
18-
property_info: true
18+
property_info:
19+
enabled: true
20+
with_constructor_extractor: true
1921
csrf_protection: true
2022
form: true

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ framework:
1010
max_depth_handler: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serializer\MaxDepthHandler
1111
default_context:
1212
enable_max_depth: true
13-
property_info: { enabled: true }
13+
property_info:
14+
enabled: true
15+
with_constructor_extractor: true
1416

1517
services:
1618
serializer.alias:

0 commit comments

Comments
 (0)
0